Sign in to follow this  
Followers 0
keilamym

Writing to a single line?

3 posts in this topic

#1 ·  Posted (edited)

i need just a little help...

i was tasked with converting workstation lists to .csv

example:

pc1

pc2

pc3

should look like

"pc1","pc2","pc3"

i already tried excel and it kept it in a list. because it was an emergency, i just did this.

WinActivate("convert.txt - Notepad", "" )

WinWait ("test","",3)

Send ("{end}" & """" & "." & """"& "{DEL}",)

Send ("{end}" & """" & "." & """"& "{DEL}",)

Doing this 800 times converted the file and all was over. But now, they need it done all the time so i want give them a tool they and they can do it there self.

I have nice little wise frontend so they can paste a workstation list, and i know how to read the lines and process commands. BUT

is there a command i can use to take the PC names and post them with quotes into a new file. Keep in mind they all have to be on the same line.

If anyone has any ideas, I'd really appreciate it.

Thanks

Edited by keilamym

Share this post


Link to post
Share on other sites



Hi,

maybe

#include <file.au3>
Dim $aRecords, $line
If Not _FileReadToArray("test.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

For $x = 1 to $aRecords[0]
    $line &= '"' & $aRecords[$x] &'",'
Next
MsgBox(0,"", StringTrimRight($line,1))

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I'll check it out and get back to you.. thanks for your help...

Hi,

maybe

#include <file.au3>
Dim $aRecords, $line
If Not _FileReadToArray("test.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf

For $x = 1 to $aRecords[0]
    $line &= '"' & $aRecords[$x] &'",'
Next
MsgBox(0,"", StringTrimRight($line,1))

So long,

Mega

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0