Sponsored Content
Full Discussion: Moving items to a new line
Top Forums Shell Programming and Scripting Moving items to a new line Post 302531972 by vipinable on Sunday 19th of June 2011 05:10:32 AM
Old 06-19-2011
sed 's/,/\n/g' file.txt
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving to a specified line number

Hi Is there any command or a trick that can take me to a specifed line number in unix . Suppose i have a file with 2000 lines and i would like to go to line number 1899 and then print out the contents of the line. regards Hrishy (2 Replies)
Discussion started by: xiamin
2 Replies

2. Shell Programming and Scripting

sh: Inserting tabs and moving text to 1 line

I trying to extract certain text from a csv file and then placing it into another csv file, but having problems getting the data to placed in one line with tab separated fields. Basically would like to have text sent to interfaces.csv in one line seperated by tabs. As it currently places files... (6 Replies)
Discussion started by: 00000008
6 Replies

3. Shell Programming and Scripting

deleting particular lines and moving a line up using perl/sed

Hi, I need convert a dump file in the following format : (please note that line numbers are provided for easy look) Original file: 1 2007-10-2482.90 No trade 0 0.00 100000.00 2 100000.00 3 0.00 4 HOLD 5 2007-10-2589.75 Bought 1114 1114 100000.00 0.00 ... (5 Replies)
Discussion started by: sabyasm
5 Replies

4. Shell Programming and Scripting

awk between items including items

OS=HP-UX ksh The following works, except I want to include the <start> and <end> in the output. awk -F '<start>' 'BEGIN{RS="<end>"; OFS="\n"; ORS=""} {print $2} somefile.log' The following work in bash but not in ksh sed -n '/^<start>/,/^<end>/{/LABEL$/!p}' somefile.log (4 Replies)
Discussion started by: Ikon
4 Replies

5. Shell Programming and Scripting

Sort items on a single line

I am creating some documentation that includes a list of packages that are to be installed for a Debian Server. This is a single line and I would like to sort the list of packages alphabetically. Using a small example of the packages, the best I could come up with was as follows: I create... (1 Reply)
Discussion started by: jelloir
1 Replies

6. Shell Programming and Scripting

Help with shell script: moving end of line character

Hello. I have a file (old.txt) that I need to copy into another file (new.txt). Each line on old.txt ends with CR/LF but the position of CR/LF varies from one record to another. I need to copy each line of record to new.txt and move CR/LF in pos 165. Can I use awk to achieve this? How?... (8 Replies)
Discussion started by: udelalv
8 Replies

7. Shell Programming and Scripting

Moving a line to the end of the file

I have a file with different directories in it. I would need to move one line within the file to the end of the list. Also not there could be blank line in the middle of it. Example /vol/fs1 /vol/fs2 /vol/fs3 /vol/fs4 /vol/fs5 /vol/fs6 /vol/fs7 So I would need /vol/fs2... (3 Replies)
Discussion started by: bombcan
3 Replies

8. Shell Programming and Scripting

Moving line up if line starts with + sign.

Hello everyone, I'm struggling with this command: awk '!/^\+/{ORS=FS}/^\+/{ORS=RS}1' file1 > file2 What I want to do is to move any line that starts with the + sign 1 up, so its the continuation of the previous. The above command is messing the whole output, can you please let me know... (8 Replies)
Discussion started by: demmel
8 Replies

9. UNIX for Dummies Questions & Answers

Moving lines of file to command line

I have a file in which each line is the name of another file. Is there a way to serve them to the command line? For example, if the file contains file1.txt file2.txt file3.txt ... file9.txt is there a way to insert them in the command as a batch? If I ran a command like grep... (4 Replies)
Discussion started by: wbport
4 Replies

10. Shell Programming and Scripting

Moving line above possible? after pattern match?

Team, would like to know if it is possibe to move line above.after TEST pattern match #cat file1 data1 data2 ok Test data1 ok Test data2 Test Output: Test (8 Replies)
Discussion started by: kenshinhimura
8 Replies
SHTOOL-SUBST.TMP(1)					      GNU Portable Shell Tool					       SHTOOL-SUBST.TMP(1)

NAME
shtool-subst - GNU shtool sed(1) substitution operations SYNOPSIS
shtool subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup ext] [-e|--exec cmd] [-f|--file cmd-file] [file] [file ...] DESCRIPTION
This command applies one or more sed(1) substitution operations to stdin or any number of files. OPTIONS
The following command line options are available. -v, --verbose Display some processing information. -t, --trace Enable the output of the essential shell commands which are executed. -n, --nop No operation mode. Actual execution of the essential shell commands which would be executed is suppressed. -w, --warning Show warning on substitution operation resulting in no content change on every file. The default is to show a warning on substitution operations resulted in no content change on all files. -q, --quiet Suppress warning on substitution operation resulting in no content change. -s, --stealth Stealth operation. Preserve timestamp on file. -i, --interactive Enter interactive mode where the user has to approve each operation. -b, --backup ext Preserve backup of original file using file name extension ext. Default is to overwrite the original file. -e, --exec cmd Specify sed(1) command directly. -f, --file cmd-file Read sed(1) command from file. EXAMPLE
# shell script shtool subst -i -e 's;(c) ([0-9]*)-2000;(c) 1-2001;' *.[ch] # RPM spec-file %install shtool subst -v -n -e 's;^(prefix=).*;1 $RPM_BUILD_ROOT%{_prefix};g' -e 's;^(sysconfdir=).*;1 $RPM_BUILD_ROOT%{_prefix}/etc;g' `find . -name Makefile -print` make install HISTORY
The GNU shtool subst command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 2001 for GNU shtool. It was prompted by the need to have a uniform and convenient patching frontend to sed(1) operations in the OpenPKG package specifications. SEE ALSO
shtool(1), sed(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-SUBST.TMP(1)
All times are GMT -4. The time now is 09:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy