Sponsored Content
Top Forums Shell Programming and Scripting awk with multiple character delimiter Post 302499765 by popawu on Friday 25th of February 2011 10:49:44 AM
Old 02-25-2011
Thx Shell_Life for this quick response.

Sorry for not being enough specific : I don't know the content of field2, and it may contain special characters. I'm just sure it does not contain "||", that's why I used it as a delimiter.

Your solution is great, but if I have another pipe in field two :

Code:
echo '"toto"||"ta|ti|a"||"titi"' | cut -d'|' -f1-4

"toto"||"ta|ti

end of field 2 is missing.

---------- Post updated at 10:49 AM ---------- Previous update was at 10:46 AM ----------

wow
I don't even have time to reply...

Thx radoulov, that was exactly what I was looking for.
Smilie

(sorry for code tags !)

Last edited by popawu; 02-25-2011 at 11:54 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How can I use double character delimiter in the cut command

Hi All, Can the cut command have double character delimiter? If yes, how can we use it. if my data file contains : apple || mango || grapes i used cut -f1 -d"||" filename but got an error. Plz help.... Thanks. (1 Reply)
Discussion started by: AshishK
1 Replies

2. UNIX for Dummies Questions & Answers

multi character delimiter

Hi All I have to encrypt files and add a suffix ".gpg_<key used>" to it For example if the file name is test.dat after encryption the file name will be test.dat.gpg_X005 (here X005 is the key). I want to decrypt the file later using that key and the original file name.both of them... (7 Replies)
Discussion started by: dr46014
7 Replies

3. Shell Programming and Scripting

php setcookie multiple values with delimiter

Hi all, setting a cookie multiple values with delimiter $value = 'TM=1276245099:LM=1276245099'; // etc etc setcookie('unix',"$value"); This generates %3ATM%3D1276245099%3ALM%3D1276245099 I want the data as it is TM=1276245099:LM=1276245099 Any suggestions? (0 Replies)
Discussion started by: ./hari.sh
0 Replies

4. Shell Programming and Scripting

Replace multiple occurances of same character with a single character.

Hi all, Greetings, I have the following scenario, The contents of main file are like : Unix|||||forum|||||||||||||||is||||||the||best so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it And i need the output in the following form: Unix=forum=is=the=best so=be=on=it ... (3 Replies)
Discussion started by: dipanchandra
3 Replies

5. Shell Programming and Scripting

Pasting multiple files using awk with delimiter

hi, i want to PASTE two files, with a delimiter in between, using awk and pipe the output to another file. i am able to achive the reqirement using PASTE command. but it has a limitation of length till 511 bytes. Example: ------- File1: ---- sam micheal file2: ---- bosco... (11 Replies)
Discussion started by: mohammedsadath
11 Replies

6. Shell Programming and Scripting

Split file into multiple files using delimiter

Hi, I have a file which has many URLs delimited by space. Now i want them to move to separate files each one holding 10 URLs per file. http://3276.e-printphoto.co.uk/guardian http://abdera.apache.org/ http://abdera.apache.org/docs/api/index.html I have used the below code to arrange... (6 Replies)
Discussion started by: vel4ever
6 Replies

7. Shell Programming and Scripting

Cutting a string using more than one character as delimiter

Hi , I have a set of files in a folder which i need to cut in to two parts.... Sample files touch AE_JUNFOR_2014_MTD_2013-05-30-03-30-02.TXT touch AE_JUNFOR_2014_YTD_2013-05-30-03-30-02.TXT touch temp_AE_JUNFOR_2014_MTD_2013-05-30-03-30-02.TXT touch... (4 Replies)
Discussion started by: chillblue
4 Replies

8. UNIX for Dummies Questions & Answers

How to replace particular occurrence of character in between a delimiter?

Hi, Hi, I have a file with following format 1|" "text " around " |" fire "guest"|" " 2| "xyz"" | "no guest"|"3" 3| """ test3""| "one" guest"|"4" My requirement is to replace all occurrences of " to ' which are occurring between |" "|delimiter so my output should look like this 1|"... (3 Replies)
Discussion started by: H_bansal
3 Replies

9. UNIX for Dummies Questions & Answers

How to use multiple delimiter?

How to split 2:6..5 in to separate columns (7 Replies)
Discussion started by: Nadela
7 Replies

10. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies
bamg2geo(1rheolef)						    rheolef-6.1 						bamg2geo(1rheolef)

NAME
bamg2geo - convert bamg mesh in geo format SYNOPSIS
bamg2geo options input[.bamg] input[.dmn] bamg2geo options input[.bamg] -Cl domlabel bamg2geo options input[.bamg] {-dom domname}* DESCRIPTION
Convert a bamg `.bamg' into `.geo' one. The output goes to standart output. The `.dmn' file specifies the domain names, since bamg mesh generator uses numbers as domain labels. EXAMPLE
bamg -g toto.bamgcad -o toto.bamg bamg2geo toto.bamg toto.dmn > toto.geo BAMG CAD FILE
This file describe the boundary of the mesh geometry. A basic example writes (See bamg documentation for more); MeshVersionFormatted 0 Dimension 2 Vertices 4 0 0 1 1 0 2 1 1 3 0 1 4 Edges 4 1 2 101 2 3 102 3 4 103 4 1 104 hVertices 0.1 0.1 0.1 0.1 DOMAIN NAME FILE
This auxilliary `.dmn' file defines the boundary domain names as used by Rheolef, since bamg uses numeric labels for domains. EdgeDomainNames 4 bottom right top left THE DOMAIN NAME FILE CAN ALSO SPECIFY ADDITIONAL VERTICES DOMAIN
EdgeDomainNames 4 bottom right top left VerticeDomainNames 4 left_bottom right_bottom right_top left_top Vertice domain names are usefull for some special boundary conditions. OPTIONS
-upgrade -noupgrade Default is to output a version 2 `.geo' file format. See geo(1). With the -noupgrade, a version 1 file format is assumed. -dom dom1 ... -dom domN SEE ALSO
geo(1) rheolef-6.1 rheolef-6.1 bamg2geo(1rheolef)
All times are GMT -4. The time now is 09:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy