Sponsored Content
Full Discussion: Format Question
Top Forums UNIX for Beginners Questions & Answers Format Question Post 303009297 by RavinderSingh13 on Tuesday 12th of December 2017 09:56:30 AM
Old 12-12-2017
Hello DallasT,

Considering that your actual Input_file is same as shown sample Input_file, could you please try following and let me know if this helps you.
Code:
awk -v s1="'" -v s2="," 'val{printf s1 val s1 s2;} {val=$0} END{printf s1 val s1 RS}'  Input_file

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

format and pkginfo -l question

I have a Solaris 2.6 box flagging an "Error block: 308918" in the messages file when I execute a pkginfo -l. pkginfo with no flags returns no errors. I think I need to use format to mark this block and then restore the database used by pkginfo for backup. Any advice/input welcome. Thanks (4 Replies)
Discussion started by: 98_1LE
4 Replies

2. UNIX for Dummies Questions & Answers

Format question

I'm trying to format a hard drive. It asks me for the disk type, which is not there for my drive. So I choose other and it says "Enter number of data cylinders". Where do I get this information from? (5 Replies)
Discussion started by: shorty
5 Replies

3. Shell Programming and Scripting

Date format question

I have a string that looks like this: 2008 04 09 18 45 30 0 I would like to convert it to a date format like this: Wed Apr 09 18:45:30.000 GMT 2008 I have been searching all over and can't find anything to help me. I am using ksh on a sun solaris unix machine. Thank you. Allyson (2 Replies)
Discussion started by: ajgwin
2 Replies

4. Shell Programming and Scripting

awk/nawk question to format a file

Hi, I am new to awk/nawk, needs help. I want to merge the rows having emplid attribute same into a single row in the following file. In actual this kind of file will have around 50k rows. Here is my input file id|emplid|firstname|dep|lastname 1|001234|test|1001|1 2|002345|test|1032|2... (7 Replies)
Discussion started by: kumar04
7 Replies

5. Solaris

Disk Format Question

Wondering if anyone could tell about how long it will take to perform 3 passes on a 72 GB disk? I have a Sun V240 and will have to format all 4. Thanks. (1 Reply)
Discussion started by: buckhtr77
1 Replies

6. Solaris

SFTP file format question

Hi, We here at State of Iowa are trying to SFTP an ascii text file off of an IBM server over to our DOL SUN Server using Solaris 5.8. After doing the secure handshake login all I am doing at present is "sftp> get testfile". Somehow in pulling the file in from the IBM server to the SUN server it... (2 Replies)
Discussion started by: wsiefkas
2 Replies

7. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

8. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

9. Shell Programming and Scripting

perl module to convert xlsx format to xls format

Hi Folks, I have written a perl script that reads data from excel sheet(.xls) using Spreadsheet::ParseExcel module. But the problem is this module doesn't work for excel sheets with extension .xlsx. I have gone through Spreadsheet::XLSX module with which we can read from .xlsx file directly.... (1 Reply)
Discussion started by: giridhar276
1 Replies

10. Shell Programming and Scripting

Question about awk format

Hi, Guys, There is one question about AWK format. Here is the code: gawk -F: '/^Dan/ {print "Dan's phone number is ",$2}' lab3.data An syntax error will come out because the quote mark between Dan and s and first quote mark are recognized as a quote pair. I want to get the input like this:... (5 Replies)
Discussion started by: franksunnn
5 Replies
Complex(3)							   OCaml library							Complex(3)

NAME
Complex - Complex numbers. Module Module Complex Documentation Module Complex : sig end Complex numbers. This module provides arithmetic operations on complex numbers. Complex numbers are represented by their real and imaginary parts (carte- sian representation). Each part is represented by a double-precision floating-point number (type float ). type t = { re : float ; im : float ; } The type of complex numbers. re is the real part and im the imaginary part. val zero : t The complex number 0 . val one : t The complex number 1 . val i : t The complex number i . val neg : t -> t Unary negation. val conj : t -> t Conjugate: given the complex x + i.y , returns x - i.y . val add : t -> t -> t Addition val sub : t -> t -> t Subtraction val mul : t -> t -> t Multiplication val inv : t -> t Multiplicative inverse ( 1/z ). val div : t -> t -> t Division val sqrt : t -> t Square root. The result x + i.y is such that x > 0 or x = 0 and y >= 0 . This function has a discontinuity along the negative real axis. val norm2 : t -> float Norm squared: given x + i.y , returns x^2 + y^2 . val norm : t -> float Norm: given x + i.y , returns sqrt(x^2 + y^2) . val arg : t -> float Argument. The argument of a complex number is the angle in the complex plane between the positive real axis and a line passing through zero and the number. This angle ranges from -pi to pi . This function has a discontinuity along the negative real axis. val polar : float -> float -> t polar norm arg returns the complex having norm norm and argument arg . val exp : t -> t Exponentiation. exp z returns e to the z power. val log : t -> t Natural logarithm (in base e ). val pow : t -> t -> t Power function. pow z1 z2 returns z1 to the z2 power. OCamldoc 2014-06-09 Complex(3)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy