I'd suggest changing the RS and/or FS built-in variables of awk, then you can input text with all newlines replaced, something like this:
That looks kinda clumsy, I have to admit... let me explain: here I first replace all newlines with spaces (tr) , then pipe to awk, which will handle it all as one record; the big regex will capture date and replace it with __FS__; and then you have your data in the fields...
Instead of 'tr' you could hack the RS built-in, and replace the newlines within awk code...
Hi,
I came across one issue recently where output from one of the columns of the table from where i am creating input file has newline characters hence, record in the file is spread over multiple lines. Fields in the file are separated by pipe (|) delimiter. As header will never have newline... (4 Replies)
Hello all,
I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person.
In the csv, a person may be listed from one to four times... (9 Replies)
Thanks everyone for the wonderful and helping environment..
And the problem I asked.. forget it... 4 days wait for a decent reply was such a moral booster.. (3 Replies)
In open office spreadsheet, i would like to fill a cell with the name of the spread sheet.
That is if the file name of spread sheet is, team.ods, then i have to fill a specific cell with that name 'team'. How to do that ?
I have more spread sheets to be created, so i want it to be done... (0 Replies)
Hi,
I have to look for the full string below in a large file(>5GB) , but that string may be spread in two lines.
string :-- "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1"
By grep "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1" file | tail -1
, I am getting incorrect result because there is a line after this also which... (1 Reply)
I have several huge files wich contains oracle table creation scripts as follows:
I would need to remove the pattern colored in red above. Any sed/awk/pearl code will be of much help.
Thanks (2 Replies)
I want to spawn n child processes but have two different classes..with the foremost one forking/spawning the child process and the latter performing a function w/ the spawned processes.
I can do this in one class with an if statement and the simple
if((pid=fork())==0) //child process
{
... (1 Reply)
Below an example of what I mean. The first attempt does what I want; the second doesn't, because bash assumes a line break means the end of an individual "command unix". Is there some way that I can convince bash to parse out, eg, to the closing parenthesis?
I'm thinking this would allow for... (1 Reply)
i need to be able to handel if multiple commands are passed into my script.
(ie) -f -r -i .
does anyone know a simple solution to handeling this. Thanks (2 Replies)