Sponsored Content
Top Forums Shell Programming and Scripting Inserting commas into file at set locations... Post 302565639 by Astrocloud on Tuesday 18th of October 2011 11:49:30 AM
Old 10-18-2011
Yes!!! Perl is awesome!
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Inserting commas and replacing backslashes with commas

Hi, Newbie here. I have a file that consists of data that I want to convert to a csv file. For example: Jul 20 2008 1111 / visit home / BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105 Jul 21 2008 22222 / add friend / BlackBerry8830/4.2.2 Profile/MIDP-2.0... (3 Replies)
Discussion started by: kangaroo
3 Replies

2. Solaris

file locations...

Hi Guys, There was a post that I saw here a while ago regarding file system layout and what to put where, which I am unable to find now.. A user here posted a man page that list what each partition should have in it and what it is used for and were you should install custom packages. ie:... (1 Reply)
Discussion started by: Tornado
1 Replies

3. Shell Programming and Scripting

Sending a file to 24 Server locations parallely

Hi All, I have to send a processed file to 24 different server locations. I feel, if this job can be done parallel in the background - Time will come down. I found the script to FTP the file for a single server location through past Unix posts as below: #!/usr/bin/ksh ftp -v -n... (16 Replies)
Discussion started by: vsmeruga
16 Replies

4. UNIX for Advanced & Expert Users

Insert Delimiter at fixed locations in a flat file

Hi Can somebody help me with solution for this PLEASE? I have a flat file and need to insert delimiters at fixed positions in all the lines so that I can easily convert into EXCEL with columns defined as per their width. For Example Here is the file { kkjhdhal sdfewss sdtereetyw... (7 Replies)
Discussion started by: jd_mca
7 Replies

5. Shell Programming and Scripting

Program to insert Delimiters at fixed locations in a file, Can you please Debug it for me??

Can someone please help?I have a file - fixed.txt----------------------------AABBBBCCCCCCDDDEEFFFFGGGGGGHHHIIJJJJKKKKKKLLL----------------------------To insert delimiters at fixed lengths of 2, 4, 6, 3, I created a file text1.txt as-------------------2463----------------------and trying to execute... (10 Replies)
Discussion started by: jd_mca
10 Replies

6. Shell Programming and Scripting

Remove leading commas in the file

Hi , I have a file with below records 965382,10310858,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 767010,10217614,3,10217616,10217622,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,... (4 Replies)
Discussion started by: vputtas@gmail.c
4 Replies

7. UNIX for Dummies Questions & Answers

Edit locations in a file

Hi , I have a file which looks like this source1 LEN predictive 392879 394347 0.955489 + . Name=sa000003.1;ID=sa000003;Alias=sa121751.1; source1 LEN descriptive_1 391082 392878 . . . Parent=sa000003.1;supp_id=.1805.1; ... (3 Replies)
Discussion started by: siya@
3 Replies

8. Shell Programming and Scripting

Merging multiple lines to columns with awk, while inserting commas for missing lines

Hello all, I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person. In the csv, a person may be listed from one to four times... (9 Replies)
Discussion started by: RalphNY
9 Replies

9. UNIX for Beginners Questions & Answers

Removing commas from CSV file

Hi I'm creating a sh script to generate a csv file. The CSV contains the values from a sql table. The content looks this: a,b,c,c2,c3,,,,,,,,,,,d,e I have some code that can separate the fields using the comma as delimiter, but some values actually contain commas, such as... (2 Replies)
Discussion started by: preema
2 Replies
funcombine(7)							SAORD Documentation						     funcombine(7)

NAME
FunCombine - Combining Region and Table Filters SYNOPSIS
This document discusses the conventions for combining region and table filters, especially with regards to the comma operator. DESCRIPTION
Comma Conventions Filter specifications consist of a series of boolean expressions, separated by commas. These expressions can be table filters, spatial region filters, or combinations thereof. Unfortunately, common usage requires that the comma operator must act differently in different situations. Therefore, while its use is intuitive in most cases, commas can be a source of confusion. According to long-standing usage in IRAF, when a comma separates two table filters, it takes on the meaning of a boolean and. Thus: foo.fits[pha==1,pi==2] is equivalent to: foo.fits[pha==1 && pi==2] When a comma separates two spatial region filters, however, it has traditionally taken on the meaning of a boolean or. Thus: foo.fits[circle(10,10,3),ellipse(20,20,8,5)] is equivalent to: foo.fits[circle(10,10,3) || ellipse(20,20,8,5)] (except that in the former case, each region is given a unique id in programs such as funcnts). Region and table filters can be combined: foo.fits[circle(10,10,3),pi=1:5] or even: foo.fits[pha==1&&circle(10,10,3),pi==2&&ellipse(20,20,8,5)] In these cases, it is not obvious whether the command should utilize an or or and operator. We therefore arbitrarily chose to implement the following rule: o if both expressions contain a region, the operator used is or. o if one (or both) expression(s) does not contain a region, the operator used is and. This rule handles the cases of pure regions and pure column filters properly. It unambiguously assigns the boolean and to all mixed cases. Thus: foo.fits[circle(10,10,3),pi=1:5] and foo.fits[pi=1:5,circle(10,10,3)] both are equivalent to: foo.fits[circle(10,10,3) && pi=1:5] [NB: This arbitrary rule replaces the previous arbitrary rule (pre-funtools 1.2.3) which stated: o if the 2nd expression contains a region, the operator used is or. o if the 2nd expression does not contain a region, the operator used is and. In that scenario, the or operator was implied by: pha==4,circle 5 5 1 while the and operator was implied by circle 5 5 1,pha==4 Experience showed that this non-commutative treatment of the comma operator was confusing and led to unexpected results.] The comma rule must be considered provisional: comments and complaints are welcome to help clarify the matter. Better still, we recommend that the comma operator be avoided in such cases in favor of an explicit boolean operator. SEE ALSO
See funtools(7) for a list of Funtools help pages version 1.4.2 January 2, 2008 funcombine(7)
All times are GMT -4. The time now is 04:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy