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...
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)
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 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)
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)
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)
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)
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)
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)
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)
Discussion started by: Prathmesh
4 Replies
LEARN ABOUT DEBIAN
file2sm
FILE2SM(1) ICI executables FILE2SM(1)NAME
file2sm - shared-memory linked list data ingestion test program
SYNOPSIS
file2sm fileName
DESCRIPTION
file2sm stress-tests shared-memory linked list data ingestion by repeatedly writing all text lines of the file named fileName to a shared-
memory linked list that is the root object of a PSM partition named "file2sm".
After writing each line to the linked list, file2sm gives a semaphore to indicate that the list is now non-empty. This is mainly for the
benefit of the complementary test program sm2file(1).
The operation of file2sm is cyclical. After copying all text lines of the source file to the linked list, file2sm appends an EOF line to
the linked list, containing the text "*** End of the file ***", and prints a brief performance report:
Processing I<lineCount> lines per second.
Then it reopens the source file and starts appending the file's text lines to the linked list again.
EXIT STATUS
0 file2sm has terminated.
FILES
No configuration files are needed.
ENVIRONMENT
No environment variables apply.
DIAGNOSTICS
Can't attach to shared memory
Operating system error. Check errtext, correct problem, and rerun.
Can't manage shared memory.
PSM error. Check for earlier diagnostic messages describing the cause of the error; correct problem and rerun.
Can't create shared memory list.
smlist error. Check for earlier diagnostic messages describing the cause of the error; correct problem and rerun.
Can't create semaphore.
ION system error. Check for earlier diagnostic messages describing the cause of the error; correct problem and rerun.
Can't open input file
Operating system error. Check errtext, correct problem, and rerun.
Can't reopen input file
Operating system error. Check errtext, correct problem, and rerun.
Can't read from input file
Operating system error. Check errtext, correct problem, and rerun.
Ran out of memory.
Nominal behavior. sm2file is not extracting data from the linked list quickly enough to prevent it from growing to consume all memory
allocated to the test partition.
BUGS
Report bugs to <ion-bugs@korgano.eecs.ohiou.edu>
SEE ALSO sm2file(1), smlist(3), psm(3)perl v5.14.2 2012-05-25 FILE2SM(1)