Skip to content

Commit e04472b

Browse files
authored
Merge pull request #469 from Caltech-IPAC/IRSA-816-ImageSetConverter
IRSA-816:Add processor to generate JSON for IRSA (IBE) from imageset master-table
2 parents 48bc0ac + ce58c67 commit e04472b

File tree

7 files changed

+309
-151
lines changed

7 files changed

+309
-151
lines changed

src/firefly/java/edu/caltech/ipac/firefly/resources/irsa-master-table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name,project,missionId,subProject,surveyKey,acronym,instrumentId,instrumentLabel,surveyKeyBand,title,wavelength,wavelengthDesc,projectTypeKey,projectTypeDesc,minRangeDeg,maxRangeDeg,helpUrl,tooltip,apiType,filter,atlasTable,dataType,imageId,Spitzer,spitzer,SEIP: Spitzer Enhanced Imaging Products,spitzer.seip_science,SEIP,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SEIP: Spitzer Enhanced Imaging Products,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.seip_science,image,,Spitzer,spitzer,SEIP: Spitzer Enhanced Imaging Products,spitzer.seip_science,SEIP,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SEIP: Spitzer Enhanced Imaging Products,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.seip_science,image,,Spitzer,spitzer,SEIP: Spitzer Enhanced Imaging Products,spitzer.seip_science,SEIP,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SEIP: Spitzer Enhanced Imaging Products,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.seip_science,image,,Spitzer,spitzer,SEIP: Spitzer Enhanced Imaging Products,spitzer.seip_science,SEIP,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SEIP: Spitzer Enhanced Imaging Products,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.seip_science,image,,Spitzer,spitzer,SEIP: Spitzer Enhanced Imaging Products,spitzer.seip_science,SEIP,mips,MIPS,MIPS4,MIPS (24 micron),24,24 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SEIP: Spitzer Enhanced Imaging Products,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.seip_science,image,,Spitzer,spitzer,Frontier: Frontier Fields,spitzer.frontier_images,Frontier,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Frontier: Frontier Fields,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.frontier_images,,,Spitzer,spitzer,Frontier: Frontier Fields,spitzer.frontier_images,Frontier,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Frontier: Frontier Fields,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.frontier_images,,,Spitzer,spitzer,Frontier: Frontier Fields,spitzer.frontier_images,Frontier,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Frontier: Frontier Fields,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.frontier_images,,,Spitzer,spitzer,Frontier: Frontier Fields,spitzer.frontier_images,Frontier,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Frontier: Frontier Fields,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.frontier_images,,,Spitzer,spitzer,Frontier: Frontier Fields,spitzer.frontier_images,Frontier,mips,MIPS,MIPS4,MIPS (24 micron),24,24 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Frontier: Frontier Fields,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.frontier_images,,,Spitzer,spitzer,S4G: Spitzer Survey of Stellar Structure in Galaxies,spitzer.s4g_images,S4G,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S4G: Spitzer Survey of Stellar Structure in Galaxies,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s4g_images,,,Spitzer,spitzer,S4G: Spitzer Survey of Stellar Structure in Galaxies,spitzer.s4g_images,S4G,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S4G: Spitzer Survey of Stellar Structure in Galaxies,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s4g_images,,,Spitzer,spitzer,S4G: Spitzer Survey of Stellar Structure in Galaxies,spitzer.s4g_images,S4G,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S4G: Spitzer Survey of Stellar Structure in Galaxies,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s4g_images,,,Spitzer,spitzer,S4G: Spitzer Survey of Stellar Structure in Galaxies,spitzer.s4g_images,S4G,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S4G: Spitzer Survey of Stellar Structure in Galaxies,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s4g_images,,,Spitzer,spitzer,S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,spitzer.s_candels_images,S-CANDELS,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s_candels_images,,,Spitzer,spitzer,S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,spitzer.s_candels_images,S-CANDELS,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s_candels_images,,,Spitzer,spitzer,S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,spitzer.s_candels_images,S-CANDELS,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s_candels_images,,,Spitzer,spitzer,S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,spitzer.s_candels_images,S-CANDELS,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is S-CANDELS: Spitzer-Cosmic Assembly Deep Near-Infrared Extragalactic Legacy Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.s_candels_images,,,Spitzer,spitzer,SERVS: Spitzer Extragalactic Representative Volume Survey,spitzer.servs_images,SERVS,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SERVS: Spitzer Extragalactic Representative Volume Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.servs_images,,,Spitzer,spitzer,SERVS: Spitzer Extragalactic Representative Volume Survey,spitzer.servs_images,SERVS,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SERVS: Spitzer Extragalactic Representative Volume Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.servs_images,,,Spitzer,spitzer,SERVS: Spitzer Extragalactic Representative Volume Survey,spitzer.servs_images,SERVS,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SERVS: Spitzer Extragalactic Representative Volume Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.servs_images,,,Spitzer,spitzer,SERVS: Spitzer Extragalactic Representative Volume Survey,spitzer.servs_images,SERVS,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SERVS: Spitzer Extragalactic Representative Volume Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.servs_images,,,Spitzer,spitzer,SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,spitzer.shela_images,SHELA,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.shela_images,,,Spitzer,spitzer,SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,spitzer.shela_images,SHELA,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.shela_images,,,Spitzer,spitzer,SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,spitzer.shela_images,SHELA,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.shela_images,,,Spitzer,spitzer,SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,spitzer.shela_images,SHELA,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SHELA: Spitzer/HETDEX Exploratory Large-Area survey ,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.shela_images,,,Spitzer,spitzer,SpIES: Spitzer IRAC Equatorial Survey,spitzer.spies_images,SpIES,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SpIES: Spitzer IRAC Equatorial Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.spies_images,,,Spitzer,spitzer,SpIES: Spitzer IRAC Equatorial Survey,spitzer.spies_images,SpIES,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SpIES: Spitzer IRAC Equatorial Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.spies_images,,,Spitzer,spitzer,SpIES: Spitzer IRAC Equatorial Survey,spitzer.spies_images,SpIES,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SpIES: Spitzer IRAC Equatorial Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.spies_images,,,Spitzer,spitzer,SpIES: Spitzer IRAC Equatorial Survey,spitzer.spies_images,SpIES,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is SpIES: Spitzer IRAC Equatorial Survey,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.spies_images,,,Spitzer,spitzer,Glimpse360 1.2,spitzer.glimpse360_0_6,GLIMPSE,irac,IRAC,IRAC1,IRAC (3.6 micron),3.6,3.6 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Glimpse360 1.2,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.glimpse360_0_6,,,Spitzer,spitzer,Glimpse360 1.2,spitzer.glimpse360_0_6,GLIMPSE,irac,IRAC,IRAC2,IRAC (4.5 micron),4.5,4.5 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Glimpse360 1.2,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.glimpse360_0_6,,,Spitzer,spitzer,Glimpse360 1.2,spitzer.glimpse360_0_6,GLIMPSE,irac,IRAC,IRAC3,IRAC (5.8 micron),5.8,2.17 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Glimpse360 1.2,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.glimpse360_0_6,,,Spitzer,spitzer,Glimpse360 1.2,spitzer.glimpse360_0_6,GLIMPSE,irac,IRAC,IRAC4,IRAC (8.0 micron),8,8 micron,survey,SURVEY,,,http://irsa.ipac.caltech.edu/data/SPITZER/Enhanced/SEIP/overview.html,this is Glimpse360 1.2,atlas,"""'file_type'=science and fname like '%.mosaic.fits'""",spitzer.glimpse360_0_6,,,2MASS,twomass,2MASS LGA,j,2MASS,,,j,2MASS J,1.25,1.25 micron,survey,SURVEY,0.008,0.139,https://www.ipac.caltech.edu/2mass/releases/docs.html,this is 2MASS LGA,twomass,,twomass.lga_images,image,,2MASS,twomass,2MASS LGA,h,2MASS,,,h,2MASS H,1.65,1.65 micron,survey,SURVEY,0.008,0.139,https://www.ipac.caltech.edu/2mass/releases/docs.html,this is 2MASS LGA,twomass,,twomass.lga_images,image,,2MASS,twomass,2MASS LGA,k,2MASS,,,k,2MASS K,2.17,2.17 micron,survey,SURVEY,0.008,0.139,https://www.ipac.caltech.edu/2mass/releases/docs.html,this is 2MASS LGA,twomass,,twomass.lga_images,image,,2MASS,twomass,2MASS AllSky,j,2MASS,,,j,2MASS J,1.25,1.25 micron,survey,SURVEY,0.008,0.139,https://www.ipac.caltech.edu/2mass/releases/docs.html,this is 2MASS AllSky,twomass,,twomass.allsky_images,image,,2MASS,twomass,2MASS AllSky,h,2MASS,,,h,2MASS H,1.65,1.65 micron,survey,SURVEY,0.008,0.139,https://www.ipac.caltech.edu/2mass/releases/docs.html,this is 2MASS AllSky,twomass,,twomass.allsky_images,image,,2MASS,twomass,2MASS AllSky,k,2MASS,,,k,2MASS K,2.17,2.17 micron,survey,SURVEY,0.008,0.139,https://www.ipac.caltech.edu/2mass/releases/docs.html,this is 2MASS AllSky,twomass,,twomass.allsky_images,image,,WISE,wise,WISE All-Sky Single Exposure (L1b) ,1b,All-Sky,,,1,W1,3.4,3.4 micron,survey,SURVEY,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Single Exposure (L1b) ,wise,,wise.wise_allsky_4band_p1bm_frm,image,,WISE,wise,WISE All-Sky Single Exposure (L1b) ,1b,All-Sky,,,2,W2,4.6,4.6 micron,survey,SURVEY,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Single Exposure (L1b) ,wise,,wise.wise_allsky_4band_p1bm_frm,image,,WISE,wise,WISE All-Sky Single Exposure (L1b) ,1b,All-Sky,,,3,W3,12,12 micron,survey,SURVEY,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Single Exposure (L1b) ,wise,,wise.wise_allsky_4band_p1bm_frm,image,,WISE,wise,WISE All-Sky Single Exposure (L1b) ,1b,All-Sky,,,4,W4,22,22 micron,survey,SURVEY,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Single Exposure (L1b) ,wise,,wise.wise_allsky_4band_p1bm_frm,image,,WISE,wise,WISE All-Sky Atlas,3a,Atlas,,,1,W1,3.4,3.4 micron,survey,SURVEY,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Atlas,wise,,wise.wise_allsky_4band_p3am_cdd,image,,WISE,wise,WISE All-Sky Atlas,3a,Atlas,,,2,W2,4.6,4.6 micron,survey,SURVEY,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Atlas,wise,,wise.wise_allsky_4band_p3am_cdd,image,,WISE,wise,WISE All-Sky Atlas,3a,Atlas,,,3,W3,12,12 micron,survey,SURVEY,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Atlas,wise,,wise.wise_allsky_4band_p3am_cdd,image,,WISE,wise,WISE All-Sky Atlas,3a,Atlas,,,4,W4,22,22 micron,,,0.01,0.2,http://irsa.ipac.caltech.edu/Missions/wise.html,this is WISE All-Sky Atlas,wise,,wise.wise_allsky_4band_p3am_cdd,image,

src/firefly/java/edu/caltech/ipac/firefly/server/util/DsvToDataGroup.java

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414
import org.apache.commons.csv.CSVPrinter;
1515
import org.apache.commons.csv.CSVRecord;
1616

17-
import java.io.BufferedReader;
18-
import java.io.BufferedWriter;
19-
import java.io.File;
20-
import java.io.FileReader;
21-
import java.io.FileWriter;
22-
import java.io.IOException;
23-
import java.io.Writer;
17+
import java.io.*;
2418
import java.util.ArrayList;
2519
import java.util.Iterator;
2620
import java.util.List;
@@ -33,14 +27,26 @@
3327
*
3428
* @author loi
3529
* @version $Id: DsvToDataGroup.java,v 1.2 2012/10/23 18:37:22 loi Exp $
30+
*
31+
* 09/28/17
32+
* LZ added another method in order to read file through an InputStream
33+
*
3634
*/
3735
public class DsvToDataGroup {
38-
private static final Logger.LoggerImpl LOG = Logger.getLogger();
3936

37+
public static DataGroup parse(InputStream inf, CSVFormat format) throws IOException {
38+
BufferedReader reader = new BufferedReader(new InputStreamReader(inf, "UTF-8"), IpacTableUtil.FILE_IO_BUFFER_SIZE);
39+
return getData(reader, format);
40+
}
4041
public static DataGroup parse(File inf, CSVFormat format) throws IOException {
4142

4243
BufferedReader reader = new BufferedReader(new FileReader(inf), IpacTableUtil.FILE_IO_BUFFER_SIZE);
44+
return getData(reader, format);
45+
46+
}
47+
4348

49+
private static DataGroup getData( BufferedReader reader, CSVFormat format)throws IOException{
4450
List<DataType> columns = new ArrayList<DataType>();
4551
CSVParser parser = new CSVParser(reader, format);
4652
List<CSVRecord> records = parser.getRecords();
@@ -50,6 +56,9 @@ public static DataGroup parse(File inf, CSVFormat format) throws IOException {
5056
CSVRecord cols = records.get(0);
5157
for(Iterator<String> itr = cols.iterator(); itr.hasNext(); ) {
5258
String s = itr.next();
59+
if ("\uFEFF".charAt(0) == s.toCharArray()[0]){
60+
s = new String(s.substring(1));//LZ fixed the issue with the BOM character
61+
}
5362
if (!StringUtils.isEmpty(s)) {
5463
columns.add(new DataType(s, null)); // unknown type
5564
}
@@ -69,7 +78,6 @@ public static DataGroup parse(File inf, CSVFormat format) throws IOException {
6978
}
7079
return null;
7180
}
72-
7381
public static void write(File outf, DataGroup data) throws IOException {
7482
write(new FileWriter(outf), data, CSVFormat.DEFAULT);
7583
}
@@ -133,9 +141,8 @@ static DataObject parseRow(DataGroup source, CSVRecord line) {
133141
return null;
134142
}
135143

136-
137144
public static void main(String[] args) {
138-
145+
139146
try {
140147
File inf = new File(args[0]);
141148
DataGroup dg = parse(inf, CSVFormat.DEFAULT);
@@ -147,4 +154,5 @@ public static void main(String[] args) {
147154
}
148155

149156
}
157+
150158
}

0 commit comments

Comments
 (0)