You are not logged in.
Hi I know nothing about Python
How can I learn to do this automatically? What functions does that?
My input is this
Text-test_20230120_text-001.zip,output
Text-test_20230120_text-002.zip,output
Text-test_20230120_text-003.zip,output
Text-test_20230120_text-006.zip,output
Text-test_20230120_text-009.zip,output
Text-test_20230120_text-013.zip,output
Text-test_20230120_text-015.zip,output
The script should check for "continuity" 001-015 if 004 is missing add that line between 003 and 006 with .zip,input if 005 is missing do the same
I want to add lines between so output would be
Text-test_20230120_text-000.zip,input
Text-test_20230120_text-001.zip,output
Text-test_20230120_text-002.zip,output
Text-test_20230120_text-003.zip,output
Text-test_20230120_text-004.zip,input
Text-test_20230120_text-005.zip,input
Text-test_20230120_text-006.zip,output
Text-test_20230120_text-007.zip,input
Text-test_20230120_text-008.zip,input
Text-test_20230120_text-009.zip,output
Text-test_20230120_text-010.zip,input
Text-test_20230120_text-011.zip,input
Text-test_20230120_text-012.zip,input
Text-test_20230120_text-013.zip,output
Text-test_20230120_text-014.zip,input
Text-test_20230120_text-015.zip,output
Or is there any easy way how to do it?
Last edited by VoDo (2023-03-12 18:39:19)
Archi3
Offline
I/we may possibly guess what you really want but you should state your requirements more clearly.
Last edited by bulletmark (2023-03-12 10:42:57)
Offline
I/we may possibly guess what you really want but you should state your requirements more clearly.
You are right that is the reason why I am not able to figured it out since I am not even able to write the problem correctly...
Is it now clearer?
Archi3
Offline
I have to ask, is this a homework assignment? If so, we can help you but the dialog will be to guide you to the answer.
You say you do not know Python. Do you code in other languages?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
And while this question might be totally valid here, you'd probably get better answers on specialized sites, such as stackoverflow.
Last edited by schard (2023-03-12 17:32:31)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
And why do you think python would be a good solution to this problem?
I'd use a printf/seq, join, sed pipeline.
Last edited by Trilby (2023-03-12 17:33:00)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
And why do you think python would be a good solution to this problem?
I'd use a printf/seq, join, sed pipeline.
Thanks I will look at this
Archi3
Offline