Sponsored Content
Full Discussion: Splitting with bash...
Top Forums Shell Programming and Scripting Splitting with bash... Post 302795823 by alister on Thursday 18th of April 2013 11:52:53 AM
Old 04-18-2013
Code:
cut -d: -f4 | fold -w16

If there's a chance that fa carriage return, backspace, or tab character can appear in the 4th field, you'll want to use fold's -b option.

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

splitting strings

Hi you, I have the following problem: I have a string like the followings: '166Mhz' or '128MB' or '300sec' or ... What I want to do is, I want to split the strings in a part with the numbers and a part with letters. Since the strings are not allway three digits and than text i couldn't do... (3 Replies)
Discussion started by: bensky
3 Replies

2. Shell Programming and Scripting

file splitting

I have an ebcdic file of 8gig into multiple chunks using the following script split -b 1024m 04122004.BIG.txt RMS the first file RMSaa looks fine. But in the second file RMSab, the first letter starts at 9th byte instead of 1st byte and therfore it chopps everynting else that falls... (1 Reply)
Discussion started by: rintingtong
1 Replies

3. Shell Programming and Scripting

splitting the files

Hi, I'am using HP-UX.I have a input file which has 102 drop statements in it.I'am using csplit to split the files.The upper limit is 99 only.I'am using the -n 102 option.It says "suffix size not vaild".Any suggestions how to do it using csplit? Thanx in advance, sounder. (1 Reply)
Discussion started by: sounder123
1 Replies

4. Shell Programming and Scripting

splitting a file

I have a huge file with 13 million records , how do i split this file into 13 files which has 1 million records in each ( each record is one line) I tried this but how to print the second million etc cat file | head -1000000 > file1 cat file | tail -1000000 >file13 please shed some... (1 Reply)
Discussion started by: ramky79
1 Replies

5. Shell Programming and Scripting

help splitting a file into multiple files in bash

I have a file that logs multiple sessions. What I would like to do is split this file inclusive of the lines that include "starting session" and "shutting down" and ignore the data before and after the beginning of the first session and the end of the last session. The output files can be called... (2 Replies)
Discussion started by: elinenbe
2 Replies

6. Shell Programming and Scripting

help in splitting

Hi experts, In the lines below I am trying to copy only the words which come after "//" into an array short nloh; // Comments int age; // Age of the person Please help me in achieving this After the code, the output of the array should Comments Age of the person (6 Replies)
Discussion started by: ramakanth_burra
6 Replies

7. Shell Programming and Scripting

splitting value

Hello, i want to take a one word from my file. -- myfile.txt -- test blablabla suPHP_ConfigPath /home/performe/etc blablabla etc. bla bla. -- myfile.txt -- How can i take performe from this file ? Thank you. (7 Replies)
Discussion started by: SAYGIN
7 Replies

8. Shell Programming and Scripting

Splitting files

Hello all I have a file which has around 80 million records, I want to split it to 12 equal files, I tried using the split command but it is allowing me to split according to number of lines or by size. Is there a way i can split the file into 12 files without worrying about the number of lines... (7 Replies)
Discussion started by: Sri3001
7 Replies

9. Shell Programming and Scripting

Splitting columns

Hi Friends, My input file has more than 20 columns UniProtKB A0A183 LCE6A GO:0031424 GO_REF:0000037 IEA UniProtKB-KW:KW-0417 P Late cornified envelope protein 6A LCE6A_HUMAN|C1orf44|LCE6A protein taxon:9606 20120303 UniProtKB ... (9 Replies)
Discussion started by: jacobs.smith
9 Replies

10. Shell Programming and Scripting

Help with splitting fields

Hi. I want to put the first field to the end and the lines are of different number of fields. How should I do this with awk? Thanks. (3 Replies)
Discussion started by: dustinwang2003
3 Replies
FOLD(1) 								FSF								   FOLD(1)

NAME
fold - wrap each input line to fit in specified width SYNOPSIS
fold [OPTION]... [FILE]... DESCRIPTION
Wrap input lines in each FILE (standard input by default), writing to standard output. Mandatory arguments to long options are mandatory for short options too. -b, --bytes count bytes rather than columns -c, --characters count characters rather than columns -s, --spaces break at spaces -w, --width=WIDTH use WIDTH columns instead of 80 --help display this help and exit --version output version information and exit AUTHOR
Written by David MacKenzie. REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for fold is maintained as a Texinfo manual. If the info and fold programs are properly installed at your site, the command info fold should give you access to the complete manual. fold (coreutils) 4.5.3 February 2003 FOLD(1)
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy