Hello ,
I'm trying to split a file which contains a single very long line.
My aim is to split this single line each 120 characters.
I tried with the sed command :
`cat ${MYPATH}/${FILE}|sed -e :a -e 's/^.\{1,120\}$/&\n/;ta' >{MYPATH}/${DEST}`
but when I wc -l the destination file it is... (2 Replies)
All,
I have a requirement where I will need to split a line into multiple lines.
Ex:
Input:
2ABCDEFGH2POIYUY2ASDGGF2QWERTY
Output:
2ABCDEFGH
2POIYUY
2ASDGGF
2QWERTY
The data is of no fixed lenght. Only the lines have to start with 2.
How can this be done. (5 Replies)
Hi,
I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest.
when i say
#cat $inputFile | while read eachLine
and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters.
Can you... (1 Reply)
Dear All,
I want to split single line into two line or three lines wherever “|” separated values comes using
Input line
test,DEMTEMPUT20100404010012,,,,,,,,|0070086|0070087,
output shoule be
test,DEMTEMPUT20100404010012,,,,,,,,0070086,
test,DEMTEMPUT20100404010012,,,,,,,,0070087, (14 Replies)
Hi,
I have the following lines that I would like to see in an array for easy comparisons and printing:
Example 1:
field1,field2,field3,field4,field5
value1,value2,value3,value4,value5Example 2:
field1,field3,field4,field2,field5,field6,field7... (7 Replies)
Example input:
John:Shepherd:770-767-4040:U.S.A:New York
Mo Jo:Jo Jo: 666-666-6666:U.S.A:Townsville
Expected Output:
First Name: John
Last Name: Shepherd
Phone Number: 770-767-4040
Country: U.S.A
State: New York
First Name: Mo Jo
Last Name: Jo Jo
Phone Number: 666-666-6666... (10 Replies)
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Hi,
I need help to split any lines that contain ; or ,
input.txtAc020 Not a good chemical process
AC030 many has failed, 3 still maintained
AC040 Putative; epithelial cells
AC050 Predicted binding activity
AC060 rodC Putative; upregulated in 48;h biofilm vs planktonic
The output... (8 Replies)
Hi All,
Greetings everyone !!!
I have a file which has many lines, out of which one line is as below.
I need to search for pattern "varchar(30) Select" and if exists, then split the line as below.
I am trying to achieve this in ksh. Can anyone help me on this. (8 Replies)
LedgerSMB::DBTest(3pm) User Contributed Perl Documentation LedgerSMB::DBTest(3pm)NAME
LedgerSMB::DBTest - LedgerSMB commit filter for test cases.
SYOPSIS
This module creates a DBI-like interface but ensures autocommit is off, and filters commit statements such that they don't do anything.
This can be used for making API test cases which involve DB commits safe for production environments.
USAGE
Both LedgerSMB.pm and LedgerSMB/Form.pm assign a global database handler for all database access within a script in the dbh property (for
example, $request->{dbh} or $form->{dbh}). By setting this early to a LedgerSMB::DBTest (instead of a DBI object), the tests can be made
safe.
However, there are a few limitations to be aware of. One cannot run tests through the standard request handler and use this module. Hence
this is limited to unit tests of files in the LedgerSMB, scripts, and bin directories.
Here is an example of how this could be done:
my $lsmb = LedgerSMB->new();
$lsmb->merge($testdata);
my $dbh = LedgerSMB::DBTest->connect("dbi:Pg:dbname=$company", "$username",
"$password",)
$lsmb->{dbh} = $dbh;
METHODS
connect($dsn, $user, $pass)
Connects to the database and returns a LedgerSMB::DBTest object
commit()
Tests the current transaction (issues a 'SELECT 1;' to the database). If this is successful returns 1, if not, rolls back and returns
false.
Note that this means all past tests are rolled back and this is inconsistent with normal transactional behavior.
prepare()
Returns a statement handle, via the private DBI database handle.
do()
passes this statement on to the private database handle
errstr()
passes this call on to the private database handle
err()
passes this call on to the private database handle
quote()
passes this call on to the private database handle
quote_identifier()
passes this call on to the private database handle
rollback()
passes this call on to the private database handle. Note that this will roll back all statements issues through this object.
perl v5.14.2 2010-03-02 LedgerSMB::DBTest(3pm)