Jump to content

Copy and edit script


Recommended Posts

So i want to create multiline files : 

It should look like this as end effect ( each saved as separate file with the same name)

{
  "Type": "pyi",
  "Google": null,
  "Token": null,
  "Google": null,
  "Ptc": "info pasted here from txt file  first part of the line      safasfasf:asafasfafas",
  "Ptcpo": "the other part of the line"   
}

How to do that?

Edited by Driveskull
Link to comment
Share on other sites

omgwut?

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Read text file with _FileReadToArray function. It will read all text in a file and return an array contains each line of that file content.  Then use DirCreate function inside a  loop to create 20 folders.  After that create a master folder and copy all the 20 folders to it. Use DirCopy function for it. 

I can't understand rest of your question. Can you please elaborate once ?

 

Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

Just now, kcvinu said:

Read text file with _FileReadToArray function. It will read all text in a file and return an array contains each line of that file content.  Then use DirCreate function inside a  loop to create 20 folders.  After that create a master folder and copy all the 20 folders to it. Use DirCopy function for it. 

I can't understand rest of your question. Can you please elaborate once ?

 

I changed this ( the first part with creating folders is simple with cmd commands) 

But how to create new file named : something.json

and looking like this : 

{
  "Type": "pyi",
  "Google": null,
  "Token": null,
  "Google": null,
  "Ptc": "info pasted here from txt file  first part of the line      safasfasf:asafasfafas",
  "Ptcpo": "the other part of the line"   
}

 with data from txt file with lines     :       afgasfasfasf:asdfasfdasfas   First part of the line should go into PTC the other into PTCPO

Link to comment
Share on other sites

So you want to enter 2 piece of data into that file. For PTC and for PTCPO. Right ?

Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

1 minute ago, kcvinu said:

So you want to enter 2 piece of data into that file. For PTC and for PTCPO. Right ?

I want to create this file first ( or  create copy of  it ) and then file PTC and PTCPO with data from different txt file 

Link to comment
Share on other sites

Ok, create it with FileWrite function. Then read the data from desired file with FileRead function. It will return a string. You can use StringSplit function to split it for PTC and for PTCPO.  Then write the splitted content with FileWrite function. That's all.

 

Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

2 minutes ago, kcvinu said:

Ok, create it with FileWrite function. Then read the data from desired file with FileRead function. It will return a string. You can use StringSplit function to split it for PTC and for PTCPO.  Then write the splitted content with FileWrite function. That's all.

 

Ok thats clears everything a bit. But still we need to create/ or copy file where the data need to be written

Link to comment
Share on other sites

If you know tha path of the file, then you can use FileCopy function. 

Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

2 hours ago, kcvinu said:

If you know tha path of the file, then you can use FileCopy function. 

Do you have maybe any easy examples of those functions? in wiki its a bit hard to understand how to use those 5 functions at the same time

Edited by Driveskull
Link to comment
Share on other sites

All example code in help file is sufficient to learn. Read it and ask any specific dout here. I can help you. :) 

Try one by one. 

Edited by kcvinu
Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...