Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Macro - Multiple Records per Account

Status
Not open for further replies.
Aug 30, 2003
41
US
Upon using the text import wizard in Excel to import data from Oracle (FIXED WIDTH DELIMITED), the data is imported in two records,not one. Any clue as to a Excel macro that would "format" the records whereby there is just one line per record?

Example
134-----1582687--937.2--2-Jul-04---24-Jul-04--1567.5---1168.83---937.2--231.63--ADMIT---DED--DISCHARGE---BLANK SPACE--BLANK SPACE--$2000


204-----1528285--985.2--5-Jul-04---23-Jul-04--1550.5---1152.83---988.2--255.63--ADMIT---DED--DISCHARGE---BLANK SPACE--BLANK SPACE--$5000


134-----1552687--526.2--9-Jul-04---23-Jul-04--1589.5---1859.83---857.2--285.63--ADMIT---DED--DISCHARGE---BLANK SPACE--BLANK SPACE--$6000


Any idea as to the possible cause?

Maybe there are more characters per line than the 132 character limit?

I am currently constructing a "IF" statement similar to "=IF A2="",C3&C4&C5..." and copying down for approximately 4000 rows every day! However, it appears that the "IF" statement does not work in all cases...

Thanks in advance.



 
Hi,

Why are you exporting TEXT from Oracle to import into Excel???

You can Query Oracle Directly from Excel and bypass this grief!

Data/Get External Data/New Query - Oracle - your table ...etc.

Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
Actually, I am importing data from a *.PRT file that was generated by an Oracle-based application. In essence, the file is generated on a daily basis in *.PDF as well as *.PRT format.

 
WHY?

You can access the data via queries DIRECTLY without the text file!

Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 

You really need more that this example. Each field has a fixed length. It's not always easy to know where data starts and ends BTW, this is a HORRIBLE text file format. Whoever produced it, had a fettish for dashes. The Date formats are not the best and acceptable praactice (month abbreviations and 2-digit year, Y2K: how soon we forget!)

When you state that the " the data is imported in two records,not one" do you mean that there are TWO records for 134 in your example? Then that's just how it is.

Have no idea what the column headings are supposed to be? It might be helpful to know.

Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top