Delimited data contains line feeds where they shouldn't be
I have some data, each record (line) ends with a line feed (\n). Each field is pipe (|) delimited.
Note that ID #2 and #4 have an extra line feed between the field delimiters. I know that awk can read multi-line data. But the examples I found are for very strictly structured multi-line data, such as addresses. In this case it is only a few rows out of a hundred thousand that are bad. The data source somehow allows for line feeds in some of the text columns. But for my purposes, I don't want/need them.
I need to clean this up before I can load it into a database. The process I use to load into the database will trim any leading and trailing spaces, so they are not an issue for this clean up here. Unfortunately I can't get that to recognize that some of the text columns might also have a \n.
Any ideas? Is there a way to tell awk that I have x number of fields and that it should keep reading until it has that many, ignoring any line feeds until the actual end of the record data?
Hi,
I have a fixed width flat file which has 1 as the first char and E as the last character. Some of the records have a carriage return /line feeds .
how do I remove them?
Let me know.
Thanks
VSK (8 Replies)
:confused: hi all,
i have csv file with three comma separated columns
i/p file
First_Name, Address, Last_Name
XXX, "456 New albany \n newyork, Unitedstates \n 45322-33", YYY\n
ZZZ, "654 rifle park \n toronto, canada \n 43L-w3b", RRR\n
is there any way i can remove \n (newline) from... (10 Replies)
Hi all,
I know this is **awfully** general but.....
I have a script which does, basically...
for file in `find command`; do
some stuff
more stuff
echo '.\c'
done
I want to output the '.' char just to give an idea of progress. However, it works fine for a while and then I... (2 Replies)
Hi gurus
I am stripping lots of email addresses from a file with this
grep "^To" file.log |awk '{print "1,"$2}' > recipients.out
file.log looks something like this:
oasndfoasnosf
To: person@email.co.uk
lsdfjosd
sdlfnmsopdfwer
dtlghodrgn
To: person2@emailsss.com
sldfnsdf
I... (5 Replies)
Hi,
I have a .properties file that a read in some values in an .sh file but everytime I put it out on the server it fails.
If I copy and paste the values of the .properties file on my local machine to the .properties file on the server it works just fine. Someone mentioned to see if it has
dos... (3 Replies)
Hi everyone,
I'm very new to using sed, run through some tutorials and everything but I've hit a problem that I'm unable to solve by myself.
I need to remove all linefeeds that are followed by a particular character (in this case a semicolon). So basically, all lines starting with a semicolon... (5 Replies)
I would like to remove carriage returns/line feeds in a text file, but in a specific cadence:
Read first line (Header Line 1), remove cr/lf at the end (replace it with a space ideally);
Read the next line (Line of Text 2), leave the cr/lf intact;
Read the next line, remove the cr/lf;
Read... (14 Replies)
I have a file as below
Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber
1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000
2345|FirstName2|MiddleName3|LastName4|
Add1 || ADD2|
234|000000000
OUTPUT :
... (1 Reply)
Discussion started by: styris
1 Replies
LEARN ABOUT DEBIAN
px_get_data_short
PX_GET_DATA_SHORT(3) Library Functions Manual PX_GET_DATA_SHORT(3)NAME
PX_get_data_short -- Get value from short data field
SYNOPSIS
#include <paradox.h>
int PX_get_data_short(pxdoc_t *pxdoc, char *data, int len, short int *value)
DESCRIPTION
Converts a data field as it stored in the database file into a short integer for the host architecture. You should use this function
instead of accessing the data directly.
data points to the start of the data field in the record. It must be calculated by summing up all field length before the field to operate
on and add it to the base pointer of the record.
Note:
This function is deprecated and obsolete if PX_retrieve_record(3) is used.
RETURN VALUE
Returns 0 if the value is NULL, -1 in case of an error and 1 otherwise.
SEE ALSO PX_get_data_byte(3), PX_get_data_long(3), PX_get_data_double(3), PX_get_data_alpha(3)AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx.
PX_GET_DATA_SHORT(3)