Multiple carriage returns within quotation marks causing new lines in csv
There is a closed thread called "carriage returns within quotation marks causing new lines in csv" that I am unable to post to, so I am starting a new thread.
The awk solution worked perfectly in most cases. We have some cases where there are multiple carriage returns within a single quoted field. Is there a way to modify this awk script to have it look for multiple occurrences of CR within a single quoted field?
The example given was:
My example would be:
Thanks for any help.
Last edited by vgersh99; 01-16-2015 at 12:47 PM..
Reason: code tags, please!
As the title suggests, i am having some trouble figuring out how to pass spaces and carriage returns to a 'here document' ie
#!/bin/bash
/usr/local/install_script.sh <<SCRIPT
yes
no
<pass carriage retun here>
yes
no
<pass a space and then a carriage return here>
exit
SCRIPT
any... (0 Replies)
i have a file like this
aaaa bbbb cccc
aaa aaaa
aa cccccccccccccccc
aaaaaaa aaaa aaaa
i want to enclose this lines with double quotation:
"aaaa bbbb cccc"
"aaa aaaa"
"aa cccccccccccccccc"
"aaaaaaa aaaa aaaa"
any idea? (preferably without using sed)
thanks in advance... (3 Replies)
Hi Fellows,
I have been struggling to fix an issue in csv records to compose sql statements and have been really losing sleep over it. Here is the problem:
I have csv files in the following pipe-delimited format:
Column1|Column2|Column3|Column4|NEWLINE
Address Type|some descriptive... (4 Replies)
I have the following string:
31-01-2012, 09:42:37;OK;94727132638;"Mozilla/5.0 (Linux; U; Android 2.2.1)";3G;WAP;I need a script which is counting the occurrence of semicolons ( ; ) but exclude the ones from the quotation marks.
In the string given as example there are 8 semicolons but the script... (3 Replies)
Hi List,
I am sure this issue must have been encountered before. I have saved an excel CSV and sent it to my linux box where I require to parse it as a CSV line by line. The file displays fine in Excel with csv headers and consistent records and fields. However when I look at it in linux I see... (2 Replies)
I'm working on AIX 6, ksh shell. The parameters are some strings quotated by double quotation marks which from a file. They are quotated because there may be spaces in them.
Example:
"015607" "10" " " "A"I want to pass these parameters to a shell function by writing the following command:
... (4 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 csv file with 3 columns. Fields are comma delimited and strings are enclosed with quotation marks "". About 40% of the time, the line of values will start a new line thanks to carriage return characters within a string.
Example:
"apple","banana","orange"
"pineapple","grape","straw... (6 Replies)
I have a CSV with carriage returns in place of newlines. I am trying to use tr to remove them, but it isn't working.
Academic year,Term,Course name,Period,Last name,Nickname
2012-2013,First Semester,English 12,4th Period,Arnold,Adam
2012-2013,First Semester,English 12,4th Period,Adams,Jim... (1 Reply)
Hello Gurus,
I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file.
1|ABC DEF|100|10
2|PQ
RS
T|200|20
3| UVWXYZ|300|30
4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies
LEARN ABOUT OPENSOLARIS
touchwin
is_linetouched(3XCURSES) X/Open Curses Library Functions is_linetouched(3XCURSES)NAME
is_linetouched, is_wintouched, touchline, touchwin, untouchwin, wtouchln - control window refresh
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
bool is_linetouched(WINDOW *win, int line);
bool is_wintouched(WINDOW *win);
int touchline(WINDOW *win, int start, int count);
int touchwin(WINDOW *win);
int untouchwin(WINDOW *win);
int wtouchln(WINDOW *win, int y, int n, int changed);
PARAMETERS
win Is a pointer to the window in which the refresh is to be controlled or monitored.
line Is the line to be checked for change since refresh.
start Is the starting line number of the portion of the window to make appear changed.
count Is the number of lines in the window to mark as changed.
y Is the starting line number of the portion of the window to make appear changed or not changed.
n Is the number of lines in the window to mark as changed.
changed Is a flag indicating whether to make lines look changed(0) or not changed(1).
DESCRIPTION
The touchwin() function marks the entire window as dirty. This makes it appear to X/Open Curses as if the whole window has been changed,
thus causing the entire window to be rewritten with the next call to refresh(3XCURSES). This is sometimes necessary when using overlapping
windows; the change to one window will not be reflected in the other and, hence will not be recorded.
The touchline() function marks as dirty a portion of the window starting at line start and continuing for count lines instead of the entire
window. Consequently, that portion of the window is updated with the next call to refresh().
The untouchwin() function marks all lines in the window as unchanged since the last refresh, ensuring that it is not updated.
The wtouchln() function marks n lines starting at line y as either changed (changed=1) or unchanged (changed=0) since the last refresh.
To find out which lines or windows have been changed since the last refresh, use the is_linetouched() and is_wintouched() functions,
respectively. These return TRUE if the specified line or window have been changed since the last call to refresh() or FALSE if no changes
have been made.
RETURN VALUES
On success, these functions return OK. Otherwise, they return ERR.
ERRORS
None.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO doupdate(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5)SunOS 5.11 5 Jun 2002 is_linetouched(3XCURSES)