Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Split Data in one column into 2 column in Excel using DOS or VBScript Post 302403275 by Franklin52 on Friday 12th of March 2010 02:51:02 AM
Old 03-12-2010
The scriptname should have .vbs as extension, the output goes to the file Outfile:

Code:
Dim filesys, Infile, Outfile, pos

Const ForReading = 1, ForWriting = 2 

file = InputBox("Filename : ")

if file = "" then
  WScript.Quit
end if

Outfile = "Outfile"

Set filesys = CreateObject("Scripting.FileSystemObject")

If NOT filesys.FileExists(file) Then
  msgbox("File " & file & " not found!")
  WScript.Quit
End If 

Set Infile = filesys.OpenTextFile(file, ForReading, True)
Set Outfile = filesys.OpenTextFile(Outfile, ForWriting, True)

do while Infile.AtEndOfStream <> true
  Line = Infile.readline
  pos = instr(Line,",")
  Line = Left(Line, pos - 1) & "|" & Mid(Line, pos + 1)
  Outfile.WriteLine(Line)
loop

Infile.Close
Outfile.Close

Set Infile = Nothing
Set Outfile = Nothing
Set filesys = Nothing

MsgBox("Ready")

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace column that matches specific pattern, with column data from another file

Can anyone please help with this? I have 2 files as given below. If 2nd column of file1 has pattern foo1@a, find the matching 1st column in file2 & replace 2nd column of file1 with file2's value. file1 abc_1 foo1@a .... abc_1 soo2@a ... def_2 soo2@a .... def_2 foo1@a ........ (7 Replies)
Discussion started by: prashali
7 Replies

2. Shell Programming and Scripting

Excel file attachment showing data in single column

Hi All, found similar posts, but not exatcly what i wanted. I have an text file like below and am trying to send mail as an excel file but when i get the excel file as the attachment, all the data is coming in the first column. I need below data in 4 columns. Unix file Name,ID,Trade,Date... (3 Replies)
Discussion started by: robinbannis
3 Replies

3. Shell Programming and Scripting

Compare 2 files and match column data and align data from 3 column

Hello experts, Please help me in achieving this in an easier way possible. I have 2 csv files with following data: File1 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:36:09,JOB_5340 08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350 08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies

4. Shell Programming and Scripting

awk to sum a column based on duplicate strings in another column and show split totals

Hi, I have a similar input format- A_1 2 B_0 4 A_1 1 B_2 5 A_4 1 and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks! letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies

5. Shell Programming and Scripting

Insert data in first column(if blank) from previous line first column

Dear Team I need to insert field(which is need to taken from previous line's first field) in first column if its blank. I had tried using sed but not find the way. Detail input and output file as below. Kindly help for same. INPUT: SCGR SC DEV DEV1 NUMDEV DCP ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

6. Shell Programming and Scripting

Split column data if the table has n number of column's

please write a shell script Table -------------------------- 1 2 3 a b c 3 4 5 c d e 7 8 9 f g h Output should be like this --------------- 1 2 3 3 4 5 7 8 9 a b c c d e f g h (1 Reply)
Discussion started by: Priti2277
1 Replies

7. Shell Programming and Scripting

Split column data if the table has n number of column's with some record

Split column data if the table has n number of column's with some record then how to split n number of colmn's line by line with records Table --------- Col1 col2 col3 col4 ....................col20 1 2 3 4 .................... 20 a b c d .................... v ... (11 Replies)
Discussion started by: Priti2277
11 Replies

8. Shell Programming and Scripting

Split column when value in column is blank in any row

Hi Experts, In short : Need to split file when field in column 5 is blank and need to generate two file in which column 5 is blank and other in which column 5 has values along with other rows and column data My issue is i am not able to get header for column from raw file into new file which... (1 Reply)
Discussion started by: as7951
1 Replies

9. UNIX for Beginners Questions & Answers

How to insert data into black column( Secound Column ) in excel (.XLSX) file using shell script?

Source Code of the original script is down below please run the script and try to solve this problem this is my data and I want it column wise 2019-03-20 13:00:00:000 2019-03-20 15:00:00:000 1 Operating System LAB 0 1 1 1 1 1 1 1 1 1 0 1 (5 Replies)
Discussion started by: Shubham1182
5 Replies

10. UNIX for Beginners Questions & Answers

How to copy a column of multiple files and paste into new excel file (next to column)?

I have data of an excel files as given below, file1 org1_1 1 1 2.5 100 org1_2 1 2 5.5 98 org1_3 1 3 7.2 88 file2 org2_1 1 1 2.5 100 org2_2 1 2 5.5 56 org2_3 1 3 7.2 70 I have multiple excel files as above shown. I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies
LZMA(1) 						      General Commands Manual							   LZMA(1)

NAME
LZMA - a compression algorithm, based on Lempel Ziv's compression method. SYNOPSIS
lzma <e|d> inputFile outputFile [switches...] DESCRIPTION
LZMA provides high compression ratio and very fast decompression, so it is very suitable for embedded applications. For example, it can be used for ROM (firmware) compression. lzma is the default and general compression method of 7z format in 7-Zip program. FUNCTION LETTERS
e Encode file d Decode file b Benchmark SWITCHES
-a{N} Set compression mode - [0, 1], default: 1 (max) -d{N} Set dictionary - [0,30], default: 23 (8MB) -fb{N} Set number of fast bytes - [5, 273], default: 128 -mc{N} Set number of cycles for match finder -lc{N} Set number of literal context bits - [0, 8], default: 3 -lp{N} Set number of literal pos bits - [0, 4], default: 0 -pb{N} Set number of pos bits - [0, 4], default: 2 -mf{MF_ID} Set Match Finder: [bt2, bt3, bt4, hc4], default: bt4 -eos Write End Of Stream marker -si Read data from stdin -so Write data to stdout SEE ALSO
7z(1),7za(1) AUTHOR
Written for Debian by Mohammed Adnene Trojette. Mohammed Adnene Trojette May 5 2006 LZMA(1)
All times are GMT -4. The time now is 04:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy