Sponsored Content
Full Discussion: Split
Top Forums UNIX for Dummies Questions & Answers Split Post 5620 by patvdv on Saturday 18th of August 2001 07:50:19 PM
Old 08-18-2001
cut

cut will do nicely for you:

var1 = $(echo ${input} | cut -f 1 -d ":")
var1 = $(echo ${input} | cut -f 2 -d ":")

etc.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Split a file with no pattern -- Split, Csplit, Awk

I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this. For example: split -l 3000000 filename.txt This is very slow and it splits the file with 3 million records in each... (10 Replies)
Discussion started by: madhunk
10 Replies

2. Shell Programming and Scripting

help with split

I have a file that reads "#ID, First, P1(40), P2(40), P3(40)..." and I need to split this line up. I first did @scores = split(/,/, $input); But I need to split it up and get the the parentheses with numbers split up too, in order to add them together later. I know I need to do at least... (1 Reply)
Discussion started by: Hawks444
1 Replies

3. Shell Programming and Scripting

split -d

pls explain me about split -d option with syntax and an example.. thanks (1 Reply)
Discussion started by: vijay_0209
1 Replies

4. Shell Programming and Scripting

split()

Hi there, Can someone tell me why the why the element of output is not the same order as the original data? Below is the value of column 11 of 2nd line,... (4 Replies)
Discussion started by: phoeberunner
4 Replies

5. Shell Programming and Scripting

Split using two delimiters

I'm trying to do a split using two delimiters. The first delimiter is ": " (or we could call it :\s). The second is "\n". How can or these delimiters so I can toss the values into an array without issue? I tried @array = split /:\s|\n/, $myvar; This doesn't seem to be working. Any an... (3 Replies)
Discussion started by: mrwatkin
3 Replies

6. Shell Programming and Scripting

Split

Hello people, I have a huge file of say 1 gb called A123.txt.. to get the word count, i do wc -l A123.txt This gives me a count of say 122898. Now what i do is, i divide this by 4 ie. 122888/4=30722 Now i copy the content as per the above count (30722) and give some name to... (6 Replies)
Discussion started by: j_panky
6 Replies

7. Shell Programming and Scripting

awk to split one field and print the last two fields within the split part.

Hello; I have a file consists of 4 columns separated by tab. The problem is the third fields. Some of the them are very long but can be split by the vertical bar "|". Also some of them do not contain the string "UniProt", but I could ignore it at this moment, and sort the file afterwards. Here is... (5 Replies)
Discussion started by: yifangt
5 Replies

8. AIX

LV split...

Hi all, I have a strange problem that I have finally given up on and thought id start hitting the forums.. Any help is greatly appreiciated. I have recently attached two new physical disks to my system and created a new volume group which inlcude these. My aim, is to create a logical volume of... (1 Reply)
Discussion started by: Dansey
1 Replies

9. Shell Programming and Scripting

How can i split this.. :)?

hello, :) How can i split this.. :) 10.25.10.2 two octet a=2 b=5 Thank you... (23 Replies)
Discussion started by: networksherlock
23 Replies

10. UNIX for Beginners Questions & Answers

Split and Rename Split Files

Hello, I need to split a file by number of records and rename each split file with actual filename pre-pended with 3 digit split number. What I have tried is the below command with 2 digit numeric value split -l 3 -d abc.txt F (# Will Produce split Files as F00 F01 F02) How to produce... (19 Replies)
Discussion started by: techedipro
19 Replies
textutil::split(n)				    Text and string utilities, macro processing 				textutil::split(n)

__________________________________________________________________________________________________________________________________________________

NAME
textutil::split - Procedures to split texts SYNOPSIS
package require Tcl 8.2 package require textutil::split ?0.7? ::textutil::split::splitn string ?len? ::textutil::split::splitx string ?regexp? _________________________________________________________________ DESCRIPTION
The package textutil::split provides commands that split strings by size and arbitrary regular expressions. The complete set of procedures is described below. ::textutil::split::splitn string ?len? This command splits the given string into chunks of len characters and returns a list containing these chunks. The argument len defaults to 1 if none is specified. A negative length is not allowed and will cause the command to throw an error. Providing an empty string as input is allowed, the command will then return an empty list. If the length of the string is not an entire multiple of the chunk length, then the last chunk in the generated list will be shorter than len. ::textutil::split::splitx string ?regexp? This command splits the string and return a list. The string is split according to the regular expression regexp instead of a simple list of chars. Note that if you parentheses are added into the regexp, the parentheses part of separator will be added into the result list as additional element. If the string is empty the result is the empty list, like for split. If regexp is empty the string is split at every character, like split does. The regular expression regexp defaults to "[\t \r\n]+". BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category textutil of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
regexp(n), split(n), string(n) KEYWORDS
regular expression, split, string CATEGORY
Text processing textutil 0.7 textutil::split(n)
All times are GMT -4. The time now is 03:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy