You can also do this with awk. Note that clist must be initialized to a list of the character positions after which a comma is added (in increasing numeric order):
With the sample input provided, it produces:
Hi,
From some time, we have noticed that our ascii files have started corrupting due to the presence of some random control characters (^@, ^M, ^H, ^D). The characters appear randomly on any file after the process that creates the file finishes. If we rerun the process, the files re creates... (0 Replies)
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Hi,
Can somebody help me with the below situation,
Input File,
========
2007_08_07_IA-0100-014_(MONTHLY).PDF
2007_08_07_IA-0100-031_(QUARTERLY)(RERUN).PDF
2008-02-28_KR-1022-003_(MONTH)(RERUN)(REC1).CSV
Required output,
============
MONTHLY
QUARTERLY
MONTH
... (15 Replies)
I try order the content from file by delimiters.
This is the text:
interface Loopback0
description !!!RID RR_SLT
ip address 172.31.128.19 255.255.255.255
interface GigabitEthernet0
description !!!P_SLT GI0/0/9
ip address 172.31.130.246 255.255.255.252
and the result that I need... (11 Replies)
Hi, gunius
I have a post as following
I use one of posted code resolved. code following.
awk -F\, 'NF==5{$3=$3""$4;$4="";sub(/,,/,",")}1' OFS="," infile
I got new problem,
my file contains some null column,
target should be
126,,shepperd street 203#, 23459
using current code, I got ... (4 Replies)
Hi,
I need to correct line breaks for huge files (more than 1MM records in a file) and then format it properly.
Except the header and trailer, each record starts with 'D'.
Requirement:Scan the whole file except the header and trailer records and see if any of the records start with... (19 Replies)
Hi all,
There are several lines in my file as
a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=44
a=3,b=dene,c=22,d=23422342334,g=vxcvxcv,h=4
a=123,b=dene,c=2312,d=234234,g=vxcvxcv,h=678
I take values with this command
awk -F '' '{print $1,$2,$3}' a.txt
I want to put values to a fix position... (6 Replies)
Hi all,
I am trying to write a script for renaming some files and I can't understand how to replace a set of characters between delimiters with sed.
The current filename is:
<ID1>_<ID2>_<DATE>_<ID3>.PDF
And I need to get the following:
<ID1>_<ID2>_<DATE>_X01<ID2>.PDF
I have tried the... (5 Replies)
I am working with a log file that I am trying to clean up by removing non-English ASCII characters. I am using Bash via Cygwin on Windows.
Before I start I set:
export LC_ALL=C
I clean it up by removing all non-English ASCII characters with the following command;
grep -v $''... (4 Replies)
Discussion started by: lewk
4 Replies
LEARN ABOUT DEBIAN
psc
PSC(1) General Commands Manual PSC(1)NAME
psc - prepare sc files
SYNOPSIS
psc [-fLkrSPv] [-s cell] [-R n] [-C n] [-n n] [-d c]
DESCRIPTION
Psc is used to prepare data for input to the spreadsheet calculator sc(1). It accepts normal ascii data on standard input. Standard out-
put is a sc file. With no options, psc starts the spreadsheet in cell A0. Strings are right justified. All data on a line is entered on
the same row; new input lines cause the output row number to increment by one. The default delimiters are tab and space. The column for-
mats are set to one larger than the number of columns required to hold the largest value in the column.
OPTIONS -f Omit column width calculations. This option is for preparing data to be merged with an existing spreadsheet. If the option is not
specified, the column widths calculated for the data read by psc will override those already set in the existing spreadsheet.
-L Left justify strings.
-k Keep all delimiters. This option causes the output cell to change on each new delimiter encountered in the input stream. The
default action is to condense multiple delimiters to one, so that the cell only changes once per input data item.
-r Output the data by row first then column. For input consisting of a single column, this option will result in output of one row
with multiple columns instead of a single column spreadsheet.
-s cell
Start the top left corner of the spreadsheet in cell. For example, -s B33 will arrange the output data so that the spreadsheet
starts in column B, row 33.
-R n Increment by n on each new output row.
-C n Increment by n on each new output column.
-n n Output n rows before advancing to the next column. This option is used when the input is arranged in a single column and the
spreadsheet is to have multiple columns, each of which is to be length n.
-d c Use the single character c as the delimiter between input fields.
-P Plain numbers only. A field is a number only when there is no imbedded [-+eE].
-S All numbers are strings.
-v Print the version of psc
SEE ALSO sc(1)AUTHOR
Robert Bond
PSC 7.16 19 September 2002 PSC(1)