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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

streaming a datafile in unix

Status
Not open for further replies.

hugheskbh

Programmer
Dec 18, 2002
37
US
HI,

I was wondering if there's a way to stream a flat file into one large data stream in unix?

Thanks in advance for help.
 
Can you give us a little more to be going on with? cat will 'stream' your file and can be redirected elsewhere. Presumably that's not what you require?
 
Hi Ken,

I have a file that has one field, but instead of the data in the file presented horizonal, I would like it to be presented as one long data stream.
 
To Unix, ALL files are just a stream of characters. There is no inherent concept of a record. A line-feed (LF) that terminates a line is just another character in the stream and must be interpretted by the application reading it as an end of record character.

So [tt]cat[/tt] is the correct answer to stream a file. Maybe also [tt]dd[/tt] depending on what you're doing.

Or, if you want it displayed one character at a time, maybe...
Code:
fold -w 1 /input/file
This looks like a stream of characters, but it's actually adding a LF after every character so it appears as a single character stream.

Please try to define what you're looking for more clearly.
 
Thanks guys,

I'll give these examples a try and let you know what happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top