Sponsored Content
Full Discussion: File operations in C pgm
Top Forums Programming File operations in C pgm Post 302640267 by Corona688 on Monday 14th of May 2012 10:49:27 AM
Old 05-14-2012
That's exactly what you asked for -- spaces in the output, just like the input.

If that's not what you want now, what do you want instead?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File operations

Hi there, I want some help on scripting regarding file processing. I have a scenario in which I have 10 files. (file1.txt, file2.txt....) and they are in paricular format. I want to read these files and append some text lines at the begining of each file and write this updated contents of... (2 Replies)
Discussion started by: chiragmistry21
2 Replies

2. UNIX for Dummies Questions & Answers

File operations

Hi I have a tab delimited file with 3 fields. I need to sort this file on the first field and remove all the records where the first field has dulplicates. For eg my file is 133|arrfdfdg|sdfdsg 234|asfsdgfs|aasdfs 133|affbfsde|dgfg When this file gets sorted I need the result to be ... (2 Replies)
Discussion started by: monks
2 Replies

3. Programming

Pgm Output is Interleaved with other pgms

Hi I have a shared object which is called from a third party tool. In my .so, I am using 'freopen(mylogfilename,"at",stderr)'. It is logging all my program output and it is also writing warning messages from the third party daemons also. How can I avoid these unwanted messages... (1 Reply)
Discussion started by: axes
1 Replies

4. UNIX for Dummies Questions & Answers

Which pgm write into a file ?

Hi! I'm looking for a command/script to be able to get the program who write into a file. I've a logfile who grow up but I don't find which program write on it :eek: thanks for your support&help. .fr. (2 Replies)
Discussion started by: Franzlebord
2 Replies

5. Shell Programming and Scripting

Unix File operations

Hi, Iam having the two files as follows: file1: ASQWEDFR09876543121234512 POIUYTREW09876512345676788 ZXCVBNMKS1209888888888888 file2: ASQWEDFR09876543121234516 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- CXADFGTU09876543121234789 asdcvfgbtg@abc.com ... (14 Replies)
Discussion started by: nivas
14 Replies

6. UNIX for Advanced & Expert Users

how to check port already used in pcap pgm

hi, I am writing one packet receiving program using libpcap library. Now, I want to check port is already using or not. how to check in receiver program.. If normal program,using bind return value we can able to check the port is already using or not. but, in pcap program how can i... (1 Reply)
Discussion started by: ram.sj
1 Replies

7. Shell Programming and Scripting

Perform Operations on One File Conditional on Data in Another File

Hello all, I am looking for a solution to the following problem. Perl or python solutions also welcome. Given this input: And this input: I want to get this output. The rule being that if the number in the first file is < 0.9, then the corresponding two columns on... (2 Replies)
Discussion started by: hydrabane
2 Replies

8. Shell Programming and Scripting

How to search and append words in the same file using unix scripting file operations

Hi , I have a file myhost.txt which contains below, 127.0.0.1 localhost 1.17.1.5 atrpx958 11.17.10.11 atrpx958zone nsybhost I need to append words only after "atrpx958" like 'myhost' and 'libhost' and not after atrpx958zone. How to search the word atrpx958(which is hostname) only,... (5 Replies)
Discussion started by: gsreeni
5 Replies

9. Shell Programming and Scripting

Operations inside a file

Hi all, i need to do a piecewise integration between this example data inside a file : 500856704.00 11536282.5600897 50496 500402784.00 11538000.3654401 -453920 500654880.00 11538000.4662785 252096 500604416.00 11539718.4330113 -50464 500907168.00 11539718.5541121 302752 500705280.00... (3 Replies)
Discussion started by: Board27
3 Replies

10. Shell Programming and Scripting

File Operations

Hi Folks, Below is example of an Input data which is used, based on the last 2, 3 & 4 column, I want my first column data to be collated as shown in the output section. a,ac,tc,ic b,ac,tc,ic c,ac,tc,ic d,ac,tc,ic b,bc,tc,ic d,bc,tc,ic e,bc,tc,ic I want my output to be ... (2 Replies)
Discussion started by: nikhil jain
2 Replies
iconv(1)						      General Commands Manual							  iconv(1)

Name
       iconv - international codeset conversion

Syntax
       iconv [-d] -f fromcodeset -t tocodeset [file...]

Description
       The  command  converts the encoding of characters in its input from one codeset to another codeset.  The fromcodeset argument specifies the
       codeset used to encode the data in the input; that is, it specifies the input codeset.  The tocodeset argument  specifies  the  codeset	to
       which  you  want  the input data converted; that is, it specifies the output codeset.  The command performs the conversion by reading rules
       from a conversion table you create.  The command reads its input from standard input or from one or more files named on the  command  line.
       The command writes its output to standard output.

       You define conversion rules in a conversion table. The conversion rules specify how converts a particular character or group of characters,
       which are called tokens.  The conversion table is a text file that contains two lists.  In the left-hand list, you specify each	token  you
       want  to convert.  In the right-hand list, you specify the token you want to create in the output file. For example, if you issued the fol-
       lowing command:
       % iconv -fupper -tlower conversion_file

       This command uses the conversion table located in the file that specifies how to convert from an uppercase codeset to a lowercase  codeset.
       The following shows part of the conversion table:
       #
       # Converts from uppercase to lowercase
       #
       #    Input token 	Output token
       #    -------------	------------------
		 A		     a
		 B		     b
		 C		     c
		 D		     d
		 E		     e
		 F		     f
		 G		     g
		 .
		 .
		 .
		 Z		     z
       #
       # Convert tabs to spaces using octal
       #
		11		  404040
       #
       # Convert the A umlaut to lowercase
       #
		    A			    a

       Each  line  in the conversion table must contain two strings, an input token and an output token.  The tokens must be delimited with spaces
       or tabs.  The backslash character (  ) either causes the command to recognize a character it normally ignores or introduces a three  digit
       octal  constant.   All octal constants in the conversion table must contain three digits.  Lines that begin with a hash symbol (#) are com-
       ments.  The command ignores comment lines and blank lines.

       You name the conversion table file using the name of the input codeset, an underscore, and the name of the output codeset.  For example, if
       your input codeset is ISO646 and your output codeset is ISO8859, you might name the conversion table file

       The  command  searches  for  the conversion table file in the directory specified by the pathname.  If the ${ICONV} environment variable is
       undefined, the command searches the directory.

       The operation of the command is 8-bit transparent.

Options
       -d Deletes any characters that are omitted from the conversion table.  By default, the command sends characters that  are  omitted  to  the
	  output file without modifying them.

       -f Specifies the name of the input codeset.

       -t Specifies the name of the output codeset.

Restrictions
       The  conversion	table file name can contain no more than 255 characters.  You may need to truncate the name of the input codeset or output
       codeset when you name the conversion table file.

Examples
       The following shows an example of using the command:

       This command converts the data in from ISO646 encoding to ISO8859 encoding.  The command reads the conversion table from the file.  If  the
       ${ICONV} environment variable is undefined, the command uses the file. If that file does not exist, the command issues an error message and
       does not convert the data file.	The command writes the results	of any conversion it performs to the file

Files
See Also
       environ(5int)
       Guide to Developing International Software

																	  iconv(1)
All times are GMT -4. The time now is 11:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy