Sponsored Content
Full Discussion: Remove line feed in data
Top Forums Shell Programming and Scripting Remove line feed in data Post 303017508 by dnat on Wednesday 16th of May 2018 06:15:46 PM
Old 05-16-2018
Remove line feed in data

Moderator's Comments:
Mod Comment
Please use code tags for sample data


Hi
I have a file where there are line feeds in the data. I am not able to read the file from an application. I exported this data from Access database and many columns contain line feed.

My data looks like this

Code:
abcd,efgh,ijkl,mnop
abcd,ef
gh,ijkl,mnop
abcd,efgh,ij
kl,mnop

I want the data as

Code:
abcd,efgh,ijkl,mnop
abcd,efgh,ijkl,mnop
abcd,efgh,ijkl,mnop

I am thinking of looping through every line until it reaches the count of delimiter(in this case 3) and remove the line feed.

Can anyone help me out!!

Last edited by jim mcnamara; 05-16-2018 at 08:47 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need script-remove line feed

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 the second... (1 Reply)
Discussion started by: gowrish
1 Replies

2. Shell Programming and Scripting

replace last form feed with line feed

Hi I have a file with lots of line feeds and form feeds (page break). Need to replace last occurrence of form feed (created by - echo "\f" ) in the file with line feed. Please advise how can i achieve this. TIA Prvn (5 Replies)
Discussion started by: prvnrk
5 Replies

3. Shell Programming and Scripting

SED remove line feed and add to certain area

Hi All, I have a xml file and requirement is to remove the line feed and add line feed after some element. <?xml version="1.0" ?> <AUDITRECORDS> <CARF> <HED> <VN1>20090616010622</VN1> <VN2>0</VN2> <VN3>1090</VN3> <VN4>CONFIG_DATA</VN4> ... (8 Replies)
Discussion started by: sreejitnair123
8 Replies

4. Shell Programming and Scripting

Get the 1st 99 characters and add new line feed at the end of the line

I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed). AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies

5. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, My requirement is to remove line (3 Replies)
Discussion started by: r_t_1601
3 Replies

6. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, i have a csv file . In the 7th column i have data that has line feed in it. Requirement is to remove the line feed from the 7th column whenever it appears There are 11 columns in the file C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
Discussion started by: r_t_1601
2 Replies

7. Shell Programming and Scripting

awk remove line feed

Hi, I've this file: 1, 2, 3, 4, 5, 6, I need to remove the line feed LF every 3 row. 1,2,3, 4,5,6, Thanks in advance, Alfredo (5 Replies)
Discussion started by: alfreale
5 Replies

8. Shell Programming and Scripting

Want to remove a line feed depending on number of tabs in a line

Hi! I have been struggling with a large file that has stray end of line characters. I am working on a Mac (Lion). I mention this only because I have been mucking around with fixing my problem using sed, and I have learned far more than I wanted to know about Unix and Mac eol characters. I... (1 Reply)
Discussion started by: user999991
1 Replies

9. Shell Programming and Scripting

awk issue splitting a fixed-width file containing line feed in data

Hi Forum. I have the following script that splits a large fixed-width file into smaller multiple fixed-width files based on input segment type. The main command in the script is: awk -v search_col_pos=$search_col_pos -v search_str_len=$search_str_len -v segment_type="$segment_type"... (8 Replies)
Discussion started by: pchang
8 Replies

10. Shell Programming and Scripting

Getting an unexpected newline in my while loop line-by-line feed

Hi, I'm trying to get a line returned as is from the below input.csv file in Bash in Linux, and somehow I get an unexpected newline in the middle of my input. Here's a sample line in input.csv $> more input.csv TEST_SYSTEM,DUMMY@GMAIL.COM|JULIA H|BROWN And here's a very basic while loop... (7 Replies)
Discussion started by: ChicagoBlues
7 Replies
QDeepCopy(3qt)															    QDeepCopy(3qt)

NAME
QDeepCopy - Template class which ensures that SYNOPSIS
All the functions in this class are reentrant when Qt is built with thread support.</p> #include <qdeepcopy.h> Public Members QDeepCopy () QDeepCopy ( const T & t ) QDeepCopy<T> & operator= ( const T & t ) operator T () DESCRIPTION
The QDeepCopy class is a template class which ensures that implicitly shared and explicitly shared classes reference unique data. Normally, shared copies reference the same data to optimize memory use and for maximum speed. In the example below, s1, s2, s3, s4 and s5 share data. // all 5 strings share the same data QString s1 = "abcd"; QString s2 = s1; QString s3 = s2; QString s4 = s3; QString s5 = s2; QDeepCopy can be used several ways to ensure that an object references unique, unshared data. In the example below, s1, s2 and s5 share data, while neither s3 nor s4 share data. // s1, s2 and s5 share the same data, neither s3 nor s4 are shared QString s1 = "abcd"; QString s2 = s1; QDeepCopy<QString> s3 = s2; // s3 is a deep copy of s2 QString s4 = s3; // s4 is a deep copy of s3 QString s5 = s2; In the example below, s1, s2 and s5 share data, and s3 and s4 share data. // s1, s2 and s5 share the same data, s3 and s4 share the same data QString s1 = "abcd"; QString s2 = s1; QString s3 = QDeepCopy<QString>( s2 ); // s3 is a deep copy of s2 QString s4 = s3; // s4 is a shallow copy of s3 QString s5 = s2; QDeepCopy can also provide safety in multithreaded applications that use shared classes. In the example below, the variable global_string is used safely since the data contained in global_string is always a deep copy. This ensures that all threads get a unique copy of the data, and that any assignments to global_string will result in a deep copy. QDeepCopy<QString> global_string; // global string data QMutex global_mutex; // mutex to protext global_string ... void setGlobalString( const QString &str ) { global_mutex.lock(); global_string = str; // global_string is a deep copy of str global_mutex.unlock(); } ... void MyThread::run() { global_mutex.lock(); QString str = global_string; // str is a deep copy of global_string global_mutex.unlock(); // process the string data ... // update global_string setGlobalString( str ); } Warning: It is the application developer's responsibility to protect the object shared across multiple threads. The examples above use QString, which is an implicitly shared class. The behavior of QDeepCopy is the same when using explicitly shared classes like QByteArray. Currently, QDeepCopy works with the following classes: QMemArray (including subclasses like QByteArray and QCString) QMap QString QValueList (including subclasses like QStringList and QValueStack) QValueVector See also Thread Support in Qt, Implicitly and Explicitly Shared Classes, and Non-GUI Classes. MEMBER FUNCTION DOCUMENTATION
QDeepCopy::QDeepCopy () Constructs an empty instance of type T. QDeepCopy::QDeepCopy ( const T & t ) Constructs a deep copy of t. QDeepCopy::operator T () Returns a deep copy of the encapsulated data. QDeepCopy<;T> & QDeepCopy::operator= ( const T & t ) Assigns a deep copy of t. SEE ALSO
http://doc.trolltech.com/qdeepcopy.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdeepcopy.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QDeepCopy(3qt)
All times are GMT -4. The time now is 09:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy