Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Loop files - Extract List Data To Individual Columns in CSV
Post: RE: Loop files - Extract List Data To Individual C...

Hi michalmonday, thank you for helping me with the revision of the code and some new python syntax. I have tested it on my text files - and yay it works so amaaaaaazing!!! I am very happy I can u...
dj99 General Coding Help 5 3,261 May-19-2019, 10:29 AM
    Thread: Loop files - Extract List Data To Individual Columns in CSV
Post: RE: Loop files - Extract List Data To Individual C...

Thank you dear friend, let me do some testing :) Thank you for your generous help
dj99 General Coding Help 5 3,261 May-18-2019, 05:21 PM
    Thread: Loop files - Extract List Data To Individual Columns in CSV
Post: RE: Loop files - Extract List Data To Individual C...

Hello friends, yes 1.txt Output:Apple 1 Apricot Avocado Banana Pear 1 Bilberry Blackberry Cherry 12.txt Output:Apple 2 Apricot Avocado Pear 2 Banana Bilberry Blackberry Blackcurrant Cherry 2I wasn...
dj99 General Coding Help 5 3,261 May-18-2019, 01:57 PM
    Thread: Loop files - Extract List Data To Individual Columns in CSV
Post: Loop files - Extract List Data To Individual Colum...

Hi friends , I am trying to extract some data to a CSV file. I have an list of values - that should be extracted from each text file. If there are 3 array values - there should be 3 columns in th...
dj99 General Coding Help 5 3,261 May-18-2019, 12:10 PM
    Thread: Delete Lines that Contain Words - Loop through files in a folder - Write to new files
Post: RE: Delete Lines that Contain Words - Loop through...

Thank you my dear friend heiner55. I am so happy because I have been trying for days to work out the correct syntax for this. I guess i didnt need the lambda thing if (any(map(lambda word: word in li...
dj99 General Coding Help 3 3,438 May-13-2019, 03:12 PM
    Thread: Delete Lines that Contain Words - Loop through files in a folder - Write to new files
Post: Delete Lines that Contain Words - Loop through fil...

Hi friends, I am trying to loop through files and from each file delete the lines that contain the search keywords import os def remove_line_from_file(filename, line_to_remove, dirpath=''): ...
dj99 General Coding Help 3 3,438 May-13-2019, 11:23 AM
    Thread: Pandas - Write to Exisitng Excel File - Sorted List
Post: RE: Pandas - Write to Exisitng Excel File - Sorted...

Hi, is there an example that can show me how to type cast, i have not been able to find anything. That applie to my example. I sorted my list I just want to write my list to excel sheet now
dj99 Data Science 4 14,894 Jul-29-2018, 07:56 AM
    Thread: Pandas - Write to Exisitng Excel File - Sorted List
Post: RE: Pandas - Write to Exisitng Excel File - Sorted...

Hello, thank you for your help I included the new code but an error came up z.to_excel(writer, 'Sheet1') AttributeError: 'list' object has no attribute 'to_excel' Yes i wanted to output my sorted...
dj99 Data Science 4 14,894 Jul-27-2018, 09:13 AM
    Thread: Pandas - Write to Exisitng Excel File - Sorted List
Post: Pandas - Write to Exisitng Excel File - Sorted Lis...

hi friends how can i write my sorted list to an exisitng excel file ie sheet name and column number from openpyxl import load_workbook import pandas as pd from pandas import ExcelWriter from panda...
dj99 Data Science 4 14,894 Jul-26-2018, 10:06 AM
    Thread: Search & Replace - Newlines Added After Replace
Post: RE: Search & Replace - Newlines Added After Replac...

Hello Buran, This is to do search and replacement in Notepad++ editor I am doing lots of search and replace originally s = l.split() does not cause this issue i tried the below editor.replace(s[0],...
dj99 General Coding Help 3 3,394 Jul-22-2018, 11:30 AM
    Thread: Search & Replace - Newlines Added After Replace
Post: Search & Replace - Newlines Added After Replace

Hi, the below script works, but it adds a new line after it replaces I cant understand why it should just do a straight replace with open('c:/Users/Dan/Desktop/Replace.txt') as f: ...
dj99 General Coding Help 3 3,394 Jul-22-2018, 10:54 AM
    Thread: Python - Limit Sentence Length to 10 Words - Text file
Post: RE: Python - Limit Sentence Length to 10 Words - T...

Thank you GJ, that did the trick Have a great weekend!
dj99 General Coding Help 2 5,187 Jul-21-2018, 02:24 PM
    Thread: Python - Limit Sentence Length to 10 Words - Text file
Post: Python - Limit Sentence Length to 10 Words - Text ...

I am trying to limit each sentence to 10 words file = open("a.txt","r") content = file.read() file.close() file_out = open("out.txt","w+") for i in range(len(content)): file_out.write(conten...
dj99 General Coding Help 2 5,187 Jul-21-2018, 01:08 PM
    Thread: HTML - Save Images From Folder - PIL
Post: RE: HTML - Save Images From Folder - PIL

Hello s, when i use this line to check the path print(os.path.join(root, image)) i get the correct path eg c:/Users/Dan/Desktop/a/images/image001.jpg When I use it in the complete code. The im...
dj99 Web Scraping & Web Development 6 7,902 Jul-17-2018, 07:46 AM
    Thread: HTML - Save Images From Folder - PIL
Post: RE: HTML - Save Images From Folder - PIL

Hello S, so all my html files have to be UTF-8 The files are just saved from a word document as Web Page html. I will do some testing thanks for the help Hello S, I have been testing on the htm...
dj99 Web Scraping & Web Development 6 7,902 Jul-15-2018, 05:45 PM
    Thread: HTML - Save Images From Folder - PIL
Post: RE: HTML - Save Images From Folder - PIL

Hello S, thank you for the pointer. It does print the images list but this error _____________________________________________ â—¾%20%20%20%20%20WPCA1_files/image001.jpg â—¾%20%20%20%20%20WPCA2_f...
dj99 Web Scraping & Web Development 6 7,902 Jul-15-2018, 03:12 PM
    Thread: HTML - Save Images From Folder - PIL
Post: HTML - Save Images From Folder - PIL

Hello, good sunday all I have found this code on so that saves images from html files - from a folder. I keep getting an error soup = bs(open(os.path.join(root, f)).read()) File "C:\Pytho...
dj99 Web Scraping & Web Development 6 7,902 Jul-15-2018, 10:55 AM
    Thread: Beautiful Soup - Title + Paragraph into a text file
Post: RE: Beautiful Soup - Title + Paragraph into a text...

Thank you S, I think i overcomplicated it with my initial looping This is a lot more simpler Have a great weekend! :)
dj99 Web Scraping & Web Development 4 6,427 Jul-14-2018, 01:37 PM
    Thread: Beautiful Soup - Title + Paragraph into a text file
Post: RE: Beautiful Soup - Title + Paragraph into a text...

Hello S, thank you for those pointers. I am trying to put these 2 lines into a text file <h2 class="Title">section1</h2> <p class ="mainparagraph">article1</p> I managed to...
dj99 Web Scraping & Web Development 4 6,427 Jul-14-2018, 12:42 PM
    Thread: Beautiful Soup - Title + Paragraph into a text file
Post: Beautiful Soup - Title + Paragraph into a text fil...

Hi all, I am trying to extract a heading and a title, there is something not quite right about this from bs4 import BeautifulSoup html = '''\ <h2 class="Title">section1</h2> <p ...
dj99 Web Scraping & Web Development 4 6,427 Jul-14-2018, 10:52 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020