Search Results

Search: Posts Made By: tattoostreet
Forum: Programming 11-06-2015
1,970
Posted By balajesuri
deletefile = Popen(["del", "sites.txt"],...
deletefile = Popen(["del", "sites.txt"], shell=True, stdout=subprocess.PIPE)
Forum: Programming 10-31-2015
3,795
Posted By Aia
with...
with open(r'C:\Users\name\OneDrive\Python\sitelist.txt') as f:
sites = f.readlines()
var=StringVar ()
var.set ('Click to Select Site')
sitelist = OptionMenu (root, var, *sites)
sitelist.pack...
Forum: Programming 10-31-2015
3,795
Posted By balajesuri
When you do list = f.read(), the entire content...
When you do list = f.read(), the entire content of file is read into list as a string. And as you know, python iterates over a string variable as if it is an array. And list here is an array of...
1,513
Posted By RudiC
Try alsosteps=" step1, step2, step3, step4,...
Try alsosteps=" step1, step2, step3, step4, step5, step7, step8, step9, step10"
echo "$steps" | tr ' ,' '-\n'
-step1
-step2
-step3
-step4
-step5
-step7
-step8
-step9
-step10
( this needs...
1,513
Posted By RavinderSingh13
Hello tattoostreet, You could try following...
Hello tattoostreet,

You could try following for same.

steps="step1, step2, step3, step4, step5, step7, step8, step9, step10"
echo $steps | awk -F", " '{for(i=1;i<=NF;i++){print $i}}'
Output...
2,586
Posted By Don Cragun
The scripts: read -p "Please enter site code: "...
The scripts:
read -p "Please enter site code: " sitecode
awk '
BEGIN {n=split ("Location,Status,Service Type,Service Provider,ID", HD, ",")
n=split ("1 6 7 8 9", FIELD)
}...
2,586
Posted By RudiC
Try awk ' BEGIN {n=split...
Try awk '
BEGIN {n=split ("Location,Status,Service Type,Service Provider,ID", HD, ",")
n=split ("1 6 7 8 9", FIELD)
}
{for (i=1; i<=n; i++) print HD[i] ":" $FIELD[i]
...
2,586
Posted By Don Cragun
Simplifying your code and adding one line to skip...
Simplifying your code and adding one line to skip the AA through DD lines:
awk '
BEGIN{n=split("Location,Status,Service Type,Service Provider,Name ID",h,",");c=n}
/AA/,/DD/{next}...
2,586
Posted By Corona688
To keep the forums high quality for all users,...
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 06:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy